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 {