Removed git dependency in build.gradle file

This commit is contained in:
Sylvain Berfini 2019-05-15 13:26:33 +02:00
parent 40ad029faf
commit 514c3f4e2b

View file

@ -45,13 +45,20 @@ excludePackage.add('**/LICENSE.txt')
def gitVersion = new ByteArrayOutputStream() def gitVersion = new ByteArrayOutputStream()
task getGitVersion { task getGitVersion {
exec { doLast {
commandLine 'git', 'describe', '--always' def result = exec {
def command = "git describe --always"
ignoreExitValue = true
executable "bash" args "-l", "-c", command
standardOutput = gitVersion standardOutput = gitVersion
} }
doLast { if (result.getExitValue() == 0) {
gitVersion = gitVersion.toString().trim() gitVersion = gitVersion.toString().trim()
println("Git version: " + gitVersion) println("Git version: " + gitVersion)
} else {
gitVersion = "unknown"
println("Git not found")
}
} }
} }