File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed
Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 22.kotlin
33build
44* /build
5+ node_modules
6+ version.txt
Original file line number Diff line number Diff line change @@ -5,6 +5,25 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
55
66plugins {
77 alias(libs.plugins.kotlin.jvm) apply false
8+ alias(libs.plugins.gitVersion)
9+ }
10+
11+ version = computeVersion()
12+ println (" Version: $version " )
13+
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+ }
827}
928
1029allprojects {
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" }
Original file line number Diff line number Diff line change 1+ {
2+ $schema : "https://docs.renovatebot.com/renovate-schema.json" ,
3+ extends : [
4+ "config:best-practices" ,
5+ // Opt-in to beta support for pre-commit.
6+ // See https://docs.renovatebot.com/modules/manager/pre-commit/
7+ ":enablePreCommit" ,
8+ // Use the same commit type as with Dependabot.
9+ ":semanticCommitTypeAll(build)"
10+ ] ,
11+ enabledManagers : [
12+ "pre-commit" ,
13+ "gradle-wrapper" ,
14+ "nvm" ,
15+ "github-actions" ,
16+ "custom.regex"
17+ ] ,
18+ }
You can’t perform that action at this time.
0 commit comments