From 7453f12e662792b682e004352d7e51f45110017d Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Tue, 21 Dec 2021 16:27:46 +0100 Subject: [PATCH] chore: Lazily change build delimiter --- build.gradle.kts | 2 +- .../main/java/com/fastasyncworldedit/core/FaweVersion.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d0bc3b838..c52c082a2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java index 5fb78e6bb..2298d491b 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java @@ -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; } }