4848version = fullVersion
4949
5050// Just printing out the SAGETV build version for informational purposes
51- // System.out.println("SAGETV VERSION ${versionArch}");
51+ // System.out.println("SAGETV VERSION ${versionArch}");
5252
5353// set gradle's buildDir to something other than the default 'build', or
5454// we'll end up deleting EVERYTHING in 'build' when we ./gradlew clean
@@ -322,19 +322,22 @@ def getBuildNumber() {
322322
323323 if (OperatingSystem . current(). isLinux()) {
324324 // use git to find the build version
325- ant. exec(
326- command : ' git rev-list HEAD --count' ,
327- os : ' Linux' ,
328- failonerror : true ,
329- outputproperty : ' sagebuildnum' )
330-
331- buildVer = ant. sagebuildnum
325+ // 03-06-2025 jusjoken: Also we should note that you will get error code 128 if you have git
326+ // installed, but you did not pull this project using git because git will not know where
327+ // to get the commit count from.
328+ new ByteArrayOutputStream (). withStream { outputStream ->
329+ exec {
330+ executable ' git'
331+ args ' rev-list' , ' HEAD' , ' --count'
332+ standardOutput = outputStream
333+ }
334+ buildVer = outputStream. toString(). trim()
335+ }
332336 } else if (OperatingSystem . current(). isWindows()) {
333337 // ensure full path to git\bin is in the Path Environment variable on windows
334338 // 04-24-2017 JS: I changed this to remove the dependency on sh. Also we should note that
335339 // you will get error code 128 if you have git installed, but you did not pull this project
336- // using git because git will not know where to get the commit count from. This is likely
337- // true for Linux too.
340+ // using git because git will not know where to get the commit count from.
338341 new ByteArrayOutputStream (). withStream { outputStream ->
339342 exec {
340343 executable ' git'
@@ -381,7 +384,7 @@ task(updateBuildNumber) {
381384 // save buildnumber to file
382385 // we'll be referencing it later
383386 // Eventually we'll do this, but for now, fetch it every time
384- // new File('.buildnumber').write(buildVersion)
387+ new File (' .buildnumber' ). write(buildVersion)
385388 }
386389}
387390
@@ -406,7 +409,7 @@ compileJava.dependsOn updateBuildNumber
406409sageJar. dependsOn cleanSageJar, classes, test
407410miniclientJar. dependsOn clean, miniclientClasses, cleanMiniJar
408411linuxMiniClientRelease. dependsOn miniclientJar
409- sageJar. finalizedBy restoreSageConstants
412+ // sageJar.finalizedBy restoreSageConstants
410413
411414// Eclipse project setup
412415eclipse {
0 commit comments