From 514c3f4e2b4dd40a443bed78ff5ef1313df6c333 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 15 May 2019 13:26:33 +0200 Subject: [PATCH] Removed git dependency in build.gradle file --- app/build.gradle | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 42ba3d7b0..33d816dd2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,13 +45,20 @@ excludePackage.add('**/LICENSE.txt') def gitVersion = new ByteArrayOutputStream() task getGitVersion { - exec { - commandLine 'git', 'describe', '--always' - standardOutput = gitVersion - } doLast { - gitVersion = gitVersion.toString().trim() - println("Git version: " + gitVersion) + def result = exec { + def command = "git describe --always" + ignoreExitValue = true + executable "bash" args "-l", "-c", command + standardOutput = gitVersion + } + if (result.getExitValue() == 0) { + gitVersion = gitVersion.toString().trim() + println("Git version: " + gitVersion) + } else { + gitVersion = "unknown" + println("Git not found") + } } }