Skip to content

Commit

Permalink
gradle 8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Nov 11, 2024
1 parent ddf3f96 commit 78cbbe7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
27 changes: 12 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,22 @@ tasks {
test {
useJUnitPlatform()
}
val commitHashTask = register("writeCommitHash") {
val commitHashTask = register<Exec>("writeCommitHash") {
group = "build"
description = "Write commit hash / version to file"
workingDir = projectDir
commandLine = "git rev-parse --short=8 HEAD".split(" ")
standardOutput = ByteArrayOutputStream()
doLast {
val byteOut = ByteArrayOutputStream()
exec {
commandLine = "git rev-parse --short=8 HEAD".split(" ")
standardOutput = byteOut
}
String(byteOut.toByteArray()).trim().let {
if (it.length > 5) {
file(layout.buildDirectory.asFile.get().absolutePath + "/resources/main/zenith_commit.txt").apply {
parentFile.mkdirs()
println("Writing commit hash: $it")
writeText(it)
}
} else {
println("Unable to determine commit hash")
val commitHash = standardOutput.toString().trim()
if (commitHash.length > 5) {
file(layout.buildDirectory.asFile.get().absolutePath + "/resources/main/zenith_commit.txt").apply {
parentFile.mkdirs()
println("Writing commit hash: $commitHash")
writeText(commitHash)
}
} else {
println("Unable to determine commit hash")
}
}
outputs.upToDateWhen { false }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 78cbbe7

Please sign in to comment.