mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
Fix building when not running in a git repo
This commit is contained in:
parent
b72270f480
commit
8a5e173a74
1 changed files with 9 additions and 7 deletions
12
build.gradle
12
build.gradle
|
@ -33,12 +33,14 @@ targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
revision = grgit.log().size()
|
if (grgit == null) {
|
||||||
hash = grgit.head().abbreviatedId
|
revision = "nogit"
|
||||||
|
} else {
|
||||||
|
revision = "${grgit.log().size()}-${grgit.head().abbreviatedId}"
|
||||||
if (file('.git/shallow').exists()) {
|
if (file('.git/shallow').exists()) {
|
||||||
// don't clone with --depth
|
// don't clone with --depth
|
||||||
revision = -1
|
revision = "-1-${shallow}"
|
||||||
hash += " shallow"
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ if (project.release != 'RELEASE') {
|
||||||
version += "-${project.release}"
|
version += "-${project.release}"
|
||||||
}
|
}
|
||||||
if (project.release == 'SNAPSHOT') {
|
if (project.release == 'SNAPSHOT') {
|
||||||
version += "-${project.revision}-${project.hash}"
|
version += "-${project.revision}"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = project.group
|
group = project.group
|
||||||
|
|
Loading…
Reference in a new issue