From ced91d5bf255351a55b99b577f56f42129c9d6d0 Mon Sep 17 00:00:00 2001 From: pahimar Date: Fri, 12 Apr 2013 13:01:37 -0400 Subject: [PATCH] Added in support for auto-incrementing build numbers into the build script (and code). A nicer way to track what version folks have :) --- build.xml | 56 +++++++++++-------- build_number.properties | 3 + .../com/pahimar/ee3/EquivalentExchange3.java | 2 +- .../pahimar/ee3/command/CommandVersion.java | 2 +- .../ee3/core/helper/VersionHelper.java | 13 ++++- ee3_common/com/pahimar/ee3/lib/Reference.java | 3 +- 6 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 build_number.properties diff --git a/build.xml b/build.xml index 7a4efeb6..dff5473b 100644 --- a/build.xml +++ b/build.xml @@ -1,53 +1,62 @@ - + + + + + + + + - - - + + + - - + + - - + + + - + - + - + - + + - - - - - + + + + + @@ -56,21 +65,22 @@ + - - - - - + + + + + - + diff --git a/build_number.properties b/build_number.properties new file mode 100644 index 00000000..9d9ab956 --- /dev/null +++ b/build_number.properties @@ -0,0 +1,3 @@ +#Fri, 12 Apr 2013 12:55:58 -0400 + +build_number=5 diff --git a/ee3_common/com/pahimar/ee3/EquivalentExchange3.java b/ee3_common/com/pahimar/ee3/EquivalentExchange3.java index 657f02e9..9d6dd310 100644 --- a/ee3_common/com/pahimar/ee3/EquivalentExchange3.java +++ b/ee3_common/com/pahimar/ee3/EquivalentExchange3.java @@ -63,7 +63,7 @@ import cpw.mods.fml.relauncher.Side; @Mod( modid = Reference.MOD_ID, name = Reference.MOD_NAME, - version = Reference.VERSION, + version = Reference.VERSION_NUMBER, dependencies = Reference.DEPENDENCIES, certificateFingerprint = Reference.FINGERPRINT) @NetworkMod( diff --git a/ee3_common/com/pahimar/ee3/command/CommandVersion.java b/ee3_common/com/pahimar/ee3/command/CommandVersion.java index 96ac18a3..8c9b8169 100644 --- a/ee3_common/com/pahimar/ee3/command/CommandVersion.java +++ b/ee3_common/com/pahimar/ee3/command/CommandVersion.java @@ -39,7 +39,7 @@ public class CommandVersion { private static void processVersionCommand(ICommandSender commandSender) { - commandSender.sendChatToPlayer(VersionHelper.getResultMessageForClient()); + commandSender.sendChatToPlayer(VersionHelper.getResultMessage()); } private static void processChangelogCommand(ICommandSender commandSender) { diff --git a/ee3_common/com/pahimar/ee3/core/helper/VersionHelper.java b/ee3_common/com/pahimar/ee3/core/helper/VersionHelper.java index 7980f009..9540d715 100644 --- a/ee3_common/com/pahimar/ee3/core/helper/VersionHelper.java +++ b/ee3_common/com/pahimar/ee3/core/helper/VersionHelper.java @@ -80,7 +80,7 @@ public class VersionHelper implements Runnable { ConfigurationHandler.set(Configuration.CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME, remoteVersion); } - if (remoteVersion.equals(Reference.VERSION)) { + if (remoteVersion.equalsIgnoreCase(getVersionForCheck())) { result = CURRENT; } else { @@ -109,6 +109,17 @@ public class VersionHelper implements Runnable { } } } + + private static String getVersionForCheck() { + String[] versionTokens = Reference.VERSION_NUMBER.split(" "); + + if (versionTokens.length >= 1) { + return versionTokens[0]; + } + else { + return Reference.VERSION_NUMBER; + } + } public static void logResult() { diff --git a/ee3_common/com/pahimar/ee3/lib/Reference.java b/ee3_common/com/pahimar/ee3/lib/Reference.java index f133c8db..c07e3f29 100644 --- a/ee3_common/com/pahimar/ee3/lib/Reference.java +++ b/ee3_common/com/pahimar/ee3/lib/Reference.java @@ -17,7 +17,7 @@ public class Reference { /* General Mod related constants */ public static final String MOD_ID = "EE3"; public static final String MOD_NAME = "Equivalent Exchange 3"; - public static final String VERSION = "@VERSION@"; + public static final String VERSION_NUMBER = "@VERSION@ (build @BUILD_NUMBER@)"; public static final String CHANNEL_NAME = MOD_ID; public static final String DEPENDENCIES = "required-after:Forge@[7.7.1.650,)"; public static final String FINGERPRINT = "@FINGERPRINT@"; @@ -26,6 +26,5 @@ public class Reference { public static final String SERVER_PROXY_CLASS = "com.pahimar.ee3.core.proxy.CommonProxy"; public static final String CLIENT_PROXY_CLASS = "com.pahimar.ee3.core.proxy.ClientProxy"; public static final int VERSION_CHECK_ATTEMPTS = 3; - public static final float MODEL_TEXTURE_OFFSET = 0.0002F; }