-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
37 lines (32 loc) · 1.2 KB
/
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
import java.util.Properties
plugins {
alias(libs.plugins.sqldelight) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.ktor) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.moko.resources) apply false
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
task("updateVersion") {
group = "versioning"
doFirst {
val versionFile = File(project.rootDir, "version.properties").also {
if (!it.exists()) it.createNewFile()
}
val versionProperties =
Properties().also {
it.load(versionFile.inputStream())
}
val version = generateVersions()
versionProperties.setProperty("code", version.code.toString())
versionProperties.setProperty("semanticName", version.semanticName)
versionProperties.setProperty("name", version.name)
versionProperties.store(versionFile.outputStream(), null)
}
}