Skip to content

Commit

Permalink
Gradle: Save project version in JAR manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
skalarproduktraum committed Apr 15, 2024
1 parent 9f0831f commit f277113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/scenery/base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tasks {
archiveVersion = rootProject.version.toString()
manifest.attributes["Implementation-Build"] = run { // retrieve the git commit hash
val gitFolder = "$projectDir/.git/"
val digit = 6
val digit = 7
/* '.git/HEAD' contains either
* in case of detached head: the currently checked out commit hash
* otherwise: a reference to a file containing the current commit hash */
Expand All @@ -137,6 +137,8 @@ tasks {
.readText()
}.trim().take(digit)
}

manifest.attributes["Implementation-Version"] = project.version
}

jacocoTestReport {
Expand Down

0 comments on commit f277113

Please sign in to comment.