mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 09:17:39 +00:00
chore: Lazily change build delimiter
This commit is contained in:
parent
78aff4c81f
commit
7453f12e66
@ -34,7 +34,7 @@ ext {
|
||||
date = git.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
|
||||
revision = "-${git.head().abbreviatedId}"
|
||||
buildNumber = if (project.hasProperty("buildnumber")) {
|
||||
snapshot + "+" + project.properties["buildnumber"] as String
|
||||
snapshot + "-" + project.properties["buildnumber"] as String
|
||||
} else {
|
||||
project.properties["snapshot"] as String
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import java.util.Locale;
|
||||
/**
|
||||
* An internal FAWE class not meant for public use.
|
||||
**/
|
||||
//TODO 18 update to semver
|
||||
public class FaweVersion {
|
||||
|
||||
public final int year;
|
||||
@ -37,7 +36,7 @@ public class FaweVersion {
|
||||
}
|
||||
this.semver = ver;
|
||||
this.snapshot = split.length > 1 && split[1].toLowerCase(Locale.ROOT).contains("snapshot");
|
||||
this.build = version.contains("+") ? Integer.parseInt(version.substring(version.indexOf('+') + 1)) : 0;
|
||||
this.build = version.contains("-") ? Integer.parseInt(version.substring(version.indexOf('-') + 10)) : 0;
|
||||
this.hash = Integer.parseInt(commit.substring(commit.indexOf('=') + 1), 16);
|
||||
String[] split2 = date.substring(date.indexOf('=') + 1).split("\\.");
|
||||
this.year = Integer.parseInt(split2[0]);
|
||||
@ -60,7 +59,7 @@ public class FaweVersion {
|
||||
return "FastAsyncWorldEdit-NoVer-SNAPSHOT";
|
||||
} else {
|
||||
String snapshot = this.snapshot ? "-SNAPSHOT" : "";
|
||||
String build = this.build > 0 ? "+" + this.build : "";
|
||||
String build = this.build > 0 ? "-" + this.build : "";
|
||||
return "FastAsyncWorldEdit-" + StringMan.join(semver, ".") + snapshot + build;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user