Gradle: fix deprecations (for Gradle 9).

This commit is contained in:
Dennis Guse
2025-02-16 20:56:58 +01:00
parent e52e1297f8
commit cc316cada0
+2 -20
View File
@@ -18,29 +18,11 @@ allprojects {
}
def getVersionName = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (ignored) {
throw new GradleException('VersionName could not be read:' + ignored.message)
}
return 'git describe --tags'.execute().text.trim()
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = stdout
}
return Integer.valueOf(stdout.toString().trim())
} catch (ignored) {
throw new GradleException('VersionCode could not be read:' + ignored.message)
}
return Integer.valueOf('git rev-list HEAD --count'.execute().text.trim())
}
android {