-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
37 lines (31 loc) · 935 Bytes
/
build.gradle.kts
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
plugins {
id("co.uzzu.dotenv.gradle") version "4.0.0"
}
group = "io.sakurasou"
tasks.register("updateVersion") {
dependsOn(":app:updateVersion", "updateComposeImageTag")
}
tasks.register("updateComposeImageTag") {
val composeFile = file("compose.yml")
val contents = composeFile.readText()
val regex = Regex("(shiinakin/hoshizora-pics:)(.*)")
val newContents = contents.replace(regex) { matchResult ->
"${matchResult.groupValues[1]}$version"
}
composeFile.writeText(newContents)
}
tasks.register("build") {
group = "build"
dependsOn(":app:build")
finalizedBy("copyBuildResultToRoot")
}
tasks.register<Copy>("copyBuildResultToRoot") {
from("${project(":app").projectDir}\\build\\libs")
include("hoshizora-pics-*.jar")
into("$projectDir/build")
}
tasks.register("clean") {
group = "build"
delete("$projectDir/build")
dependsOn(":app:clean", ":ui:clean")
}