-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
46 lines (39 loc) · 1.15 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
46 lines (39 loc) · 1.15 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
import org.gradle.api.tasks.testing.Test
plugins {
kotlin("multiplatform") version "2.4.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.4.10" apply false
id("com.android.kotlin.multiplatform.library") version "9.1.1" apply false
id("com.adarshr.test-logger") version "4.0.0" apply false
id("com.vanniktech.maven.publish") version "0.37.0" apply false
idea
}
fun calculateVersion(baseVersion: String): String {
return try {
val branch = ProcessBuilder("git", "rev-parse", "--abbrev-ref", "HEAD")
.redirectErrorStream(true)
.start()
.inputStream
.bufferedReader()
.readText()
.trim()
if (branch == "master" || branch == "main") {
baseVersion
} else {
"$baseVersion-SNAPSHOT"
}
} catch (_: Exception) {
baseVersion
}
}
group = "net.igsoft.polyglot"
version = calculateVersion("0.3.2")
println("Version: $version")
allprojects {
group = rootProject.group
version = rootProject.version
}
subprojects {
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
}