Skip to content

Commit c9db7cd

Browse files
committed
Updates to build.gradle to run under ubuntu 22.04
1 parent 2840f49 commit c9db7cd

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ext {
4848
version = 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,22 +322,22 @@ def getBuildNumber() {
322322

323323
if (OperatingSystem.current().isLinux()) {
324324
// 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+
}
335336
} else if (OperatingSystem.current().isWindows()) {
336337
//ensure full path to git\bin is in the Path Environment variable on windows
337338
// 04-24-2017 JS: I changed this to remove the dependency on sh. Also we should note that
338339
// 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.
341341
new ByteArrayOutputStream().withStream { outputStream ->
342342
exec {
343343
executable 'git'

0 commit comments

Comments
 (0)