feat: 插件骨架(里程碑 1)
- Gradle 工程:devtools 0.8.0 + 平台 BOM 2.26.0,JDK 21 toolchain - plugin.yaml:operation-audit,requires >=2.26.0 - OperationAuditPlugin 入口(@Component) - ui 子项目:Vue 3 + Vite 6 + @halo-dev/components 2.26.0,占位页 + 菜单注册,npm 构建(legacy-peer-deps 对齐 pnpm 行为) - ./gradlew build 通过,jar 内含 plugin.yaml / console 前端产物 / 组件索引
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id "run.halo.plugin.devtools" version "0.8.0"
|
||||
}
|
||||
|
||||
group = 'run.halo.operationaudit'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation platform('run.halo.tools.platform:plugin:2.26.0')
|
||||
compileOnly 'run.halo.app:api'
|
||||
|
||||
testImplementation 'run.halo.app:api'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
options.release = 21
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events 'passed', 'skipped', 'failed'
|
||||
}
|
||||
}
|
||||
|
||||
// 将 ui 子项目构建产物打包进插件 jar 的 console/ 目录(Console 前端入口 main.js)
|
||||
tasks.register('processUiResources', Copy) {
|
||||
from project(':ui').layout.buildDirectory.dir('dist')
|
||||
into layout.buildDirectory.dir('resources/main/console')
|
||||
dependsOn project(':ui').tasks.named('assemble')
|
||||
shouldRunAfter tasks.named('processResources')
|
||||
}
|
||||
|
||||
tasks.named('classes') {
|
||||
dependsOn tasks.named('processUiResources')
|
||||
}
|
||||
|
||||
tasks.named('generatePluginComponentsIdx') {
|
||||
notCompatibleWithConfigurationCache('This task invokes "Task.project" at execution time, which is not supported with configuration cache.')
|
||||
}
|
||||
|
||||
halo {
|
||||
version = '2.26.1'
|
||||
}
|
||||
Reference in New Issue
Block a user