Skip to content

Commit 5849156

Browse files
committed
ci: use version from tag
1 parent c4e8dac commit 5849156

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

build.gradle.kts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,11 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
55

66
plugins {
77
alias(libs.plugins.kotlin.jvm) apply false
8-
alias(libs.plugins.gitVersion)
98
}
109

11-
version = computeVersion()
10+
version = file("version.txt").takeIf { it.exists() }?.readText()?.trim() ?: "0.0.1-SNAPSHOT"
1211
println("Version: $version")
1312

14-
fun computeVersion(): Any {
15-
val versionFile = file("version.txt")
16-
val gitVersion: groovy.lang.Closure<String> by extra
17-
return if (versionFile.exists()) {
18-
versionFile.readText().trim()
19-
} else {
20-
gitVersion()
21-
// Avoid duplicated "-SNAPSHOT" ending
22-
.let { if (it.endsWith("-SNAPSHOT")) it else "$it-SNAPSHOT" }
23-
// Normalize the version so that is always a valid NPM version.
24-
.let { if (it.matches("""\d+\.\d+.\d+-.*""".toRegex())) it else "0.0.1-$it" }
25-
.also { versionFile.writeText(it) }
26-
}
27-
}
28-
2913
allprojects {
3014
repositories {
3115
maven { url = uri("https://artifacts.itemis.cloud/repository/maven-mps/") }

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "2.0.21" }
1010
shadow = { id = "com.gradleup.shadow", version = "9.0.0-beta6" }
1111
binaryCompatibility = { id ="org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.17.0" }
12-
gitVersion = { id = "com.palantir.git-version", version = "3.1.0" }

0 commit comments

Comments
 (0)