Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (84 loc) · 2.47 KB
/
Copy pathbuild.gradle
File metadata and controls
100 lines (84 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
plugins {
id 'java'
id "io.freefair.lombok" version "9.2.0"
id "run.halo.plugin.devtools" version "0.8.0"
}
group 'run.halo.live2d'
repositories {
maven {
url = uri('https://central.sonatype.com/repository/maven-snapshots/')
mavenContent {
snapshotsOnly()
}
}
mavenCentral()
}
configurations.runtimeClasspath {
exclude group: 'com.fasterxml.jackson.core'
}
dependencies {
implementation platform('run.halo.tools.platform:plugin:2.24.0')
compileOnly 'run.halo.app:api'
compileOnly 'run.halo.aifoundation:api:1.0.0-SNAPSHOT'
testImplementation 'run.halo.app:api'
testImplementation 'run.halo.aifoundation:api:1.0.0-SNAPSHOT'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
test {
useJUnitPlatform()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = 21
}
def live2dFrontendDir = file("packages/live2d")
def generatedFrontendResourcesDir = layout.buildDirectory.dir("generated/resources/main/static/live2d")
tasks.register("installFrontendDependencies", Exec) {
workingDir = projectDir
commandLine "pnpm", "install", "--frozen-lockfile"
inputs.files(
file("package.json"),
file("pnpm-lock.yaml"),
file("pnpm-workspace.yaml"),
file("${live2dFrontendDir}/package.json")
)
outputs.dirs(
file("node_modules"),
file("${live2dFrontendDir}/node_modules")
)
}
tasks.register("buildFrontend", Exec) {
dependsOn tasks.named("installFrontendDependencies")
workingDir = projectDir
commandLine "pnpm", "--dir", live2dFrontendDir.absolutePath, "build"
inputs.dir(fileTree(dir: live2dFrontendDir, excludes: ["dist/**", "node_modules/**"]))
outputs.dir(file("${live2dFrontendDir}/dist"))
}
tasks.register("syncFrontendAssets", Sync) {
dependsOn tasks.named("buildFrontend")
from("${live2dFrontendDir}/dist")
into(generatedFrontendResourcesDir)
}
tasks.named("processResources") {
dependsOn tasks.named("syncFrontendAssets")
from(generatedFrontendResourcesDir) {
into "static/live2d"
}
}
halo {
version = '2.25'
port = 8092
superAdminUsername = 'admin'
superAdminPassword = 'admin'
debug = true
}
build {
// build frontend before build
tasks.getByName('compileJava')
}