|
48 | 48 | version = fullVersion |
49 | 49 |
|
50 | 50 | // Just printing out the SAGETV build version for informational purposes |
51 | | -// System.out.println("SAGETV VERSION ${versionArch}"); |
| 51 | +//System.out.println("SAGETV VERSION ${versionArch}"); |
52 | 52 |
|
53 | 53 | // set gradle's buildDir to something other than the default 'build', or |
54 | 54 | // we'll end up deleting EVERYTHING in 'build' when we ./gradlew clean |
@@ -322,22 +322,22 @@ def getBuildNumber() { |
322 | 322 |
|
323 | 323 | if (OperatingSystem.current().isLinux()) { |
324 | 324 | // use git to find the build version |
325 | | - //no longer works as deprecated in newer ant |
326 | | - /* |
327 | | - ant.exec( |
328 | | - command: 'git rev-list HEAD --count', |
329 | | - os: 'Linux', |
330 | | - failonerror: true, |
331 | | - outputproperty: 'sagebuildnum') |
332 | | -
|
333 | | - buildVer = ant.sagebuildnum |
334 | | - */ |
| 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 | + } |
335 | 336 | } else if (OperatingSystem.current().isWindows()) { |
336 | 337 | //ensure full path to git\bin is in the Path Environment variable on windows |
337 | 338 | // 04-24-2017 JS: I changed this to remove the dependency on sh. Also we should note that |
338 | 339 | // you will get error code 128 if you have git installed, but you did not pull this project |
339 | | - // using git because git will not know where to get the commit count from. This is likely |
340 | | - // true for Linux too. |
| 340 | + // using git because git will not know where to get the commit count from. |
341 | 341 | new ByteArrayOutputStream().withStream { outputStream -> |
342 | 342 | exec { |
343 | 343 | executable 'git' |
|
0 commit comments