From 78cbbe79a3359f8a991b963d12bbcc5856b15cca Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:46:33 -0800 Subject: [PATCH] gradle 8.11 --- build.gradle.kts | 27 +++++++++++------------- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 03854cac..f562b4fb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -122,25 +122,22 @@ tasks { test { useJUnitPlatform() } - val commitHashTask = register("writeCommitHash") { + val commitHashTask = register("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 } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b..94113f20 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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