File tree Expand file tree Collapse file tree 2 files changed +1
-18
lines changed
Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -5,27 +5,11 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
55
66plugins {
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 "
1211println (" 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-
2913allprojects {
3014 repositories {
3115 maven { url = uri(" https://artifacts.itemis.cloud/repository/maven-mps/" ) }
Original file line number Diff line number Diff line change 99kotlin-jvm = { id = " org.jetbrains.kotlin.jvm" , version = " 2.0.21" }
1010shadow = { id = " com.gradleup.shadow" , version = " 9.0.0-beta6" }
1111binaryCompatibility = { id =" org.jetbrains.kotlinx.binary-compatibility-validator" , version = " 0.17.0" }
12- gitVersion = { id = " com.palantir.git-version" , version = " 3.1.0" }
You can’t perform that action at this time.
0 commit comments