From 868ff8fe8c97c7d65e8c7673e741c874f34d5470 Mon Sep 17 00:00:00 2001 From: iadgovuser59 <133057011+iadgovuser59@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:29:59 -0400 Subject: [PATCH] Fix to build.gradle on Eclipse --- build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index d9ea99ac..58e98210 100644 --- a/build.gradle +++ b/build.gradle @@ -26,11 +26,12 @@ def buildTime = { -> } def gitHash = { -> - def gitProcess = 'git rev-parse --short HEAD'.execute(); - gitProcess.waitFor(); - def shortHash = gitProcess.text.trim(); - def gitHash = shortHash.substring(0, shortHash.length() - 2); - return gitHash; + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() } project.ext["jarVersion"] = "${projectVersion}.${buildTime}.${gitHash}"