Skip to content

Commit

Permalink
Always get package version from the property, to prevent version inco…
Browse files Browse the repository at this point in the history
…nsistency
  • Loading branch information
ericeil committed Oct 17, 2023
1 parent 1fe9b3a commit 552a29a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ plugins {
id("io.github.detekt.gradle.compiler-plugin")
id("java-library")
id("maven-publish")
id("com.palantir.git-version") version "3.0.0"
}

subprojects {
apply(plugin = "java-library")
apply(plugin = "com.palantir.git-version")
apply(plugin = "maven-publish")

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(property("javaVersion").toString()))
Expand All @@ -39,7 +37,6 @@ subprojects {
}
}


publishing {
publications {
repositories {
Expand All @@ -55,9 +52,7 @@ subprojects {

withType<MavenPublication> {
version = if (project.hasProperty("release")) {
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
val details = versionDetails()
"${details.lastTag}"
"${project.version}"
} else {
"${project.version}-SNAPSHOT"
}
Expand All @@ -74,9 +69,8 @@ subprojects {
developerConnection.set("scm:git:ssh://github.com/Certora/collections.git")
url.set("https://github.com/Certora/collections/")
}
}
}
}
}
}

}
}

0 comments on commit 552a29a

Please sign in to comment.