-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
69 lines (54 loc) · 1.3 KB
/
build.gradle.kts
File metadata and controls
69 lines (54 loc) · 1.3 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
import com.github.gradle.node.yarn.task.YarnTask
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.plugin.serialization)
alias(libs.plugins.shadow)
alias(libs.plugins.node)
application
}
group = "starry.memebrowser"
version = "1.0.0"
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
api(libs.bundles.kotlinx.ecosystem)
api(libs.fuzzy.search)
api(libs.auxframework.application)
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}
application {
mainClass = "starry.memebrowser.MemeBrowserKt"
}
node {
download = true
version = "22.4.1"
yarnVersion = "1.22.19"
}
val yarnInstall = tasks.register<YarnTask>("yarnInstall") {
dependsOn(tasks.yarn)
workingDir.set(file("src-vue"))
args.set(listOf()) // 执行构建
}
val yarnBuild = tasks.register<YarnTask>("yarnBuild") {
dependsOn(yarnInstall)
workingDir.set(file("src-vue"))
args.set(listOf("build-only")) // 执行构建
}
val copyVueDist = tasks.register<Copy>("copyVueDist") {
dependsOn(yarnBuild) // 依赖于 yarnBuild 任务
from("src-vue/dist")
into(layout.buildDirectory.dir("resources/main/public"))
}
tasks.processResources {
dependsOn(copyVueDist)
}
tasks.clean {
delete.add("src-vue/dist")
}