1.4.3原版
This commit is contained in:
+102
@@ -0,0 +1,102 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id "com.github.node-gradle.node" version "7.0.2"
|
||||
id "io.freefair.lombok" version "8.0.1"
|
||||
id "run.halo.plugin.devtools" version "0.2.0"
|
||||
}
|
||||
|
||||
group 'la.moony.friends'
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
|
||||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation platform('run.halo.tools.platform:plugin:2.20.0-SNAPSHOT')
|
||||
compileOnly 'run.halo.app:api'
|
||||
|
||||
testImplementation 'run.halo.app:api'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
implementation 'com.rometools:rome:2.1.0'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
node {
|
||||
nodeProjectDir = file("${project.projectDir}")
|
||||
}
|
||||
|
||||
tasks.register('buildFrontend', PnpmTask) {
|
||||
args = ['build']
|
||||
dependsOn('installDepsForUI')
|
||||
}
|
||||
|
||||
tasks.register('installDepsForUI', PnpmTask) {
|
||||
args = ['install']
|
||||
}
|
||||
|
||||
build {
|
||||
// build frontend before build
|
||||
tasks.named('compileJava').configure {
|
||||
dependsOn('buildFrontend')
|
||||
}
|
||||
}
|
||||
|
||||
halo {
|
||||
version = '2.21.0'
|
||||
superAdminUsername = 'admin'
|
||||
superAdminPassword = 'admin'
|
||||
externalUrl = 'http://localhost:8081'
|
||||
docker {
|
||||
// windows 需要改为 npipe:////./pipe/docker_engine
|
||||
// linux、macos 需要改为 unix:///var/run/docker.sock
|
||||
url = 'unix:///var/run/docker.sock'
|
||||
apiVersion = '1.48'
|
||||
}
|
||||
port = 8081
|
||||
|
||||
// 开启 debug 断点模式
|
||||
debug = true
|
||||
debugPort = 5011
|
||||
|
||||
containerName = 'plugin-friends'
|
||||
// 控制台会挂起,等待点击 Attach debugger 按钮
|
||||
suspend = true
|
||||
}
|
||||
|
||||
haloPlugin {
|
||||
openApi {
|
||||
outputDir = file("$rootDir/api-docs/openapi/v3_0")
|
||||
// 用于定义 API 分组规则
|
||||
groupingRules {
|
||||
// 此名称为 group name,定义后 groupedApiMappings 中的 /v3/api-docs/ 后的名称需要与之相同,要避免与 halo 中已经存在的 group 相同避免生成后出现与插件无关的 API
|
||||
pluginFriendsApi {
|
||||
// 分组显示名称
|
||||
displayName = 'Extension API for Plugin Friends'
|
||||
// 分组的 API 规则
|
||||
pathsToMatch = ["/apis/friend.moony.la/v1alpha1/**",
|
||||
"/apis/api.friend.moony.la/v1alpha1/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
groupedApiMappings = [
|
||||
'/v3/api-docs/pluginFriendsApi': 'pluginFriendsApi.json'
|
||||
]
|
||||
generator {
|
||||
// 默认配置可缺省
|
||||
outputDir = file("${projectDir}/ui/src/api/generated")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user