mirror of https://github.com/cabaletta/baritone
Don't crash the build if git is not available
This commit is contained in:
parent
20d62c68bf
commit
9accb2bfb0
|
@ -21,13 +21,18 @@ allprojects {
|
||||||
apply plugin: "maven-publish"
|
apply plugin: "maven-publish"
|
||||||
|
|
||||||
archivesBaseName = rootProject.archives_base_name
|
archivesBaseName = rootProject.archives_base_name
|
||||||
def vers = 'git describe --always --tags --first-parent --dirty'.execute().text.trim()
|
def vers = ""
|
||||||
|
try {
|
||||||
|
vers = 'git describe --always --tags --first-parent --dirty'.execute().text.trim()
|
||||||
|
} catch (Exception e) {
|
||||||
|
println "Version detection failed: " + e
|
||||||
|
}
|
||||||
if (!vers.startsWith("v")) {
|
if (!vers.startsWith("v")) {
|
||||||
println "git doesn't appear to be installed!"
|
|
||||||
println "using version number: " + rootProject.mod_version
|
println "using version number: " + rootProject.mod_version
|
||||||
version = rootProject.mod_version
|
version = rootProject.mod_version
|
||||||
} else {
|
} else {
|
||||||
version = vers.substring(1)
|
version = vers.substring(1)
|
||||||
|
println "Detected version " + version
|
||||||
}
|
}
|
||||||
group = rootProject.maven_group
|
group = rootProject.maven_group
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue