From 5ddd0303d438dbc60f10c3153e991693fd82b1bb Mon Sep 17 00:00:00 2001 From: Dennis Guse Date: Sun, 16 Feb 2025 20:56:58 +0100 Subject: [PATCH] Gradle: fix deprecations (for Gradle 9). --- build.gradle | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index aa73f9998..75cfe2532 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {