Skip to content

Commit

Permalink
Gradle: fix deprecations (for Gradle 9).
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisguse committed Feb 16, 2025
1 parent c18290d commit 5ddd030
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5ddd030

Please sign in to comment.