[android] Fix gradle deprecations

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-04 23:36:34 +02:00
committed by Konstantin Pastbin
parent 21020429cb
commit 3e2e6cb487
4 changed files with 31 additions and 32 deletions

View File

@@ -7,19 +7,17 @@ plugins {
}
def run(cmd) {
def stdout = new ByteArrayOutputStream()
exec {
commandLine = cmd
standardOutput = stdout
def output = providers.exec {
commandLine = cmd
}
return stdout.toString()
return output.standardOutput.asText.get().trim()
}
def getVersion() {
def isWindows = DefaultNativePlatform.getCurrentOperatingSystem().isWindows()
def bash = isWindows ? 'C:\\Program Files\\Git\\bin\\bash.exe' : 'bash'
def versionCode = Integer.parseInt(run([bash, '../tools/unix/version.sh', 'android_code']).trim())
def versionName = run([bash, '../tools/unix/version.sh', 'android_name']).trim()
def versionCode = Integer.parseInt(run([bash, '../tools/unix/version.sh', 'android_code']))
def versionName = run([bash, '../tools/unix/version.sh', 'android_name'])
return new Tuple2(versionCode, versionName)
}