diff options
author | Roman / Nea <roman.graef@gmail.com> | 2022-01-27 11:21:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 21:21:50 +1100 |
commit | 3a21023cdaf23f51ad27e0ec769adc47c8d3e44d (patch) | |
tree | 047b3889c58846592bf87538adf8a6960afd59c8 | |
parent | 6675186d9dd16898ab259a7be97ee7f089ea20be (diff) | |
download | NotEnoughUpdates-3a21023cdaf23f51ad27e0ec769adc47c8d3e44d.tar.gz NotEnoughUpdates-3a21023cdaf23f51ad27e0ec769adc47c8d3e44d.tar.bz2 NotEnoughUpdates-3a21023cdaf23f51ad27e0ec769adc47c8d3e44d.zip |
Build Number (#70)
Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com>
-rw-r--r-- | build.gradle.kts | 19 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 26a89ab5..e824a9a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ +import java.io.ByteArrayOutputStream import net.minecraftforge.gradle.user.ReobfMappingType - plugins { java id("net.minecraftforge.gradle.forge") version "6f5327738df" @@ -8,7 +8,22 @@ plugins { } group = "io.github.moulberry" -version = "2.1" +val baseVersion = "2.1" + + +var buildVersion = properties["BUILD_VERSION"] +if (buildVersion == null) { + val stdout = ByteArrayOutputStream() + val execResult = exec { + commandLine("git", "describe", "--always", "--first-parent", "--abbrev=7") + standardOutput = stdout + } + if (execResult.exitValue == 0) + buildVersion = String(stdout.toByteArray()).trim() +} + +version = baseVersion + (buildVersion?.let { "+$it" } ?: "") + // Toolchains: diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index 525e8aea..f069a0e0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -120,7 +120,7 @@ public class StatsCommand extends ClientCommandBase { builder.category("Neu Settings"); builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiKey.apiKey.isEmpty() ? "FALSE" : "TRUE"); builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); - builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getSource().getName()); + builder.append("Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getDisplayVersion()); builder.append("SB Profile", SBInfo.getInstance().currentProfile); builder.append("Has Advanced Tab", SBInfo.getInstance().hasNewTab ? "TRUE" : "FALSE"); builder.category("Repo Stats"); |