mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
git not required to build
This commit is contained in:
parent
8948645832
commit
e9cbd7a51e
10
build.gradle
10
build.gradle
@ -24,6 +24,7 @@ def buildNumber = ""
|
|||||||
def semver = ""
|
def semver = ""
|
||||||
def date = ""
|
def date = ""
|
||||||
ext {
|
ext {
|
||||||
|
try {
|
||||||
git = org.ajoberstar.grgit.Grgit.open(file(".git"))
|
git = org.ajoberstar.grgit.Grgit.open(file(".git"))
|
||||||
date = git.head().date.format("yy.MM.dd")
|
date = git.head().date.format("yy.MM.dd")
|
||||||
revision = "-${git.head().abbreviatedId}"
|
revision = "-${git.head().abbreviatedId}"
|
||||||
@ -31,7 +32,7 @@ ext {
|
|||||||
index = -96; // Offset to match CI
|
index = -96; // Offset to match CI
|
||||||
int major, minor, patch;
|
int major, minor, patch;
|
||||||
major = minor = patch = 0;
|
major = minor = patch = 0;
|
||||||
for (;parents != null && !parents.isEmpty();index++) {
|
for (; parents != null && !parents.isEmpty(); index++) {
|
||||||
int majorCount, minorCount, patchCount;
|
int majorCount, minorCount, patchCount;
|
||||||
patchCount = minor == 0 && major == 0 ? 1 : 0;
|
patchCount = minor == 0 && major == 0 ? 1 : 0;
|
||||||
commit = git.getResolve().toCommit(parents.get(0));
|
commit = git.getResolve().toCommit(parents.get(0));
|
||||||
@ -43,7 +44,9 @@ ext {
|
|||||||
case "change":
|
case "change":
|
||||||
case "changed":
|
case "changed":
|
||||||
case "changes":
|
case "changes":
|
||||||
if (major == 0) {minorCount = 1; patchCount = 0;}
|
if (major == 0) {
|
||||||
|
minorCount = 1; patchCount = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "refactor":
|
case "refactor":
|
||||||
case "remove":
|
case "remove":
|
||||||
@ -60,6 +63,9 @@ ext {
|
|||||||
}
|
}
|
||||||
buildNumber = "-${index}"
|
buildNumber = "-${index}"
|
||||||
semver = "-${major}.${minor}.${patch}"
|
semver = "-${major}.${minor}.${patch}"
|
||||||
|
} catch (Throwable ignore) {
|
||||||
|
revision = "unknown";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version = date + revision + buildNumber + semver
|
version = date + revision + buildNumber + semver
|
||||||
|
Loading…
Reference in New Issue
Block a user