From a45a5145421fe27c84ea30c57ec9dd9565bc5e3a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 30 Apr 2017 23:14:03 -0700 Subject: [PATCH] Updated to new semver template format. --- .../net/thauvin/erik/mobibot/ReleaseInfo.java | 48 +++++++++---------- .../net/thauvin/erik/mobibot/Mobibot.java | 6 +-- version.mustache | 46 +++++++++--------- version.properties | 6 +-- 4 files changed, 53 insertions(+), 53 deletions(-) rename src/generated/java/{ => sources}/net/thauvin/erik/mobibot/ReleaseInfo.java (60%) diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/sources/net/thauvin/erik/mobibot/ReleaseInfo.java similarity index 60% rename from src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java rename to src/generated/java/sources/net/thauvin/erik/mobibot/ReleaseInfo.java index ea0b0ff..3a5ec39 100644 --- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/generated/java/sources/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -13,19 +13,19 @@ import java.time.*; * Annotation Processor */ public final class ReleaseInfo { - private final static String DEFAULT_PRERELEASE_PREFIX = "-"; - private final static String DEFAULT_BUILDMETA_PREFIX = "+"; + public final static String PRERELEASE_PREFIX = "-"; + public final static String BUILDMETA_PREFIX = "+"; - public final static String project = "mobibot"; - public final static LocalDateTime buildDate = - LocalDateTime.ofInstant(Instant.ofEpochMilli(1492880264977L), ZoneId.systemDefault()); - public final static int major = 0; - public final static int minor = 7; - public final static int patch = 1; - public final static String preRelease = "beta"; - public final static String buildMeta = "018"; + public final static String PROJECT = "mobibot"; + public final static LocalDateTime BUILDDATE = + LocalDateTime.ofInstant(Instant.ofEpochMilli(1493616818868L), ZoneId.systemDefault()); + public final static int MAJOR = 0; + public final static int MINOR = 7; + public final static int PATCH = 1; + public final static String PRERELEASE = "beta"; + public final static String BUILDMETA = "018"; - /** + /** * The full version string. *

* Formatted as: @@ -41,9 +41,9 @@ public final class ReleaseInfo { *

  • 1.0.0-alpha+001
  • * */ - public final static String version = Integer.toString(major) + '.' - + Integer.toString(minor) + '.' - + Integer.toString(patch) + public final static String VERSION = Integer.toString(MAJOR) + '.' + + Integer.toString(MINOR) + '.' + + Integer.toString(PATCH) + preReleaseWithPrefix() + buildMetaWithPrefix(); /** @@ -57,12 +57,12 @@ public final class ReleaseInfo { } /** - * Returns the build metadata with default prefix. + * Returns the build metadata with {@value #BUILDMETA_PREFIX} prefix. * * @return The build metadata, if any. */ public static String buildMetaWithPrefix() { - return buildMetaWithPrefix(DEFAULT_PRERELEASE_PREFIX); + return buildMetaWithPrefix(BUILDMETA_PREFIX); } /** @@ -72,20 +72,20 @@ public final class ReleaseInfo { * @return The build metadata, if any. */ public static String buildMetaWithPrefix(final String prefix) { - if (buildMeta.length() > 0 && prefix.length() > 0) { - return prefix + buildMeta; + if (BUILDMETA.length() > 0 && prefix.length() > 0) { + return prefix + BUILDMETA; } else { - return buildMeta; + return BUILDMETA; } } /** - * Returns the pre-release version with default prefix. + * Returns the pre-release version with {@value #PRERELEASE_PREFIX} prefix. * * @return The pre-release version, if any. */ public static String preReleaseWithPrefix() { - return preReleaseWithPrefix(DEFAULT_PRERELEASE_PREFIX); + return preReleaseWithPrefix(PRERELEASE_PREFIX); } /** @@ -95,10 +95,10 @@ public final class ReleaseInfo { * @return The pre-release version, if any. */ public static String preReleaseWithPrefix(final String prefix) { - if (preRelease.length() > 0 && prefix.length() > 0) { - return prefix + preRelease; + if (PRERELEASE.length() > 0 && prefix.length() > 0) { + return prefix + PRERELEASE; } else { - return preRelease; + return PRERELEASE; } } } \ No newline at end of file diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index 6b80946..801720f 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -69,7 +69,7 @@ public class Mobibot extends PircBot { // The info strings. private static final String[] INFO_STRS = { - ReleaseInfo.project + " v" + ReleaseInfo.version + " by Erik C. Thauvin (erik@thauvin.net)", + ReleaseInfo.PROJECT + " v" + ReleaseInfo.VERSION + " by Erik C. Thauvin (erik@thauvin.net)", "http://www.mobitopia.org/mobibot/" }; @@ -100,9 +100,9 @@ public class Mobibot extends PircBot { // The version strings. private static final String[] VERSION_STRS = { "Version: " - + ReleaseInfo.version + + ReleaseInfo.VERSION + " (" - + Utils.isoLocalDate(ReleaseInfo.buildDate) + ')', + + Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')', "Platform: " + System.getProperty("os.name") + " (" diff --git a/version.mustache b/version.mustache index 6be70c2..8cb1997 100644 --- a/version.mustache +++ b/version.mustache @@ -13,19 +13,19 @@ import java.time.*; * Annotation Processor */ public final class {{className}} { - private final static String DEFAULT_PRERELEASE_PREFIX = "-"; - private final static String DEFAULT_BUILDMETA_PREFIX = "+"; + public final static String PRERELEASE_PREFIX = "-"; + public final static String BUILDMETA_PREFIX = "+"; - public final static String project = "{{project}}"; - public final static LocalDateTime buildDate = + public final static String PROJECT = "{{project}}"; + public final static LocalDateTime BUILDDATE = LocalDateTime.ofInstant(Instant.ofEpochMilli({{epoch}}L), ZoneId.systemDefault()); - public final static int major = {{major}}; - public final static int minor = {{minor}}; - public final static int patch = {{patch}}; - public final static String preRelease = "{{preRelease}}"; - public final static String buildMeta = "{{buildMeta}}"; + public final static int MAJOR = {{major}}; + public final static int MINOR = {{minor}}; + public final static int PATCH = {{patch}}; + public final static String PRERELEASE = "{{preRelease}}"; + public final static String BUILDMETA = "{{buildMeta}}"; - /** + /** * The full version string. *

    * Formatted as: @@ -41,9 +41,9 @@ public final class {{className}} { *

  • 1.0.0-alpha+001
  • * */ - public final static String version = Integer.toString(major) + '.' - + Integer.toString(minor) + '.' - + Integer.toString(patch) + public final static String VERSION = Integer.toString(MAJOR) + '.' + + Integer.toString(MINOR) + '.' + + Integer.toString(PATCH) + preReleaseWithPrefix() + buildMetaWithPrefix(); /** @@ -57,12 +57,12 @@ public final class {{className}} { } /** - * Returns the build metadata with default prefix. + * Returns the build metadata with {@value #BUILDMETA_PREFIX} prefix. * * @return The build metadata, if any. */ public static String buildMetaWithPrefix() { - return buildMetaWithPrefix(DEFAULT_PRERELEASE_PREFIX); + return buildMetaWithPrefix(BUILDMETA_PREFIX); } /** @@ -72,20 +72,20 @@ public final class {{className}} { * @return The build metadata, if any. */ public static String buildMetaWithPrefix(final String prefix) { - if (buildMeta.length() > 0 && prefix.length() > 0) { - return prefix + buildMeta; + if (BUILDMETA.length() > 0 && prefix.length() > 0) { + return prefix + BUILDMETA; } else { - return buildMeta; + return BUILDMETA; } } /** - * Returns the pre-release version with default prefix. + * Returns the pre-release version with {@value #PRERELEASE_PREFIX} prefix. * * @return The pre-release version, if any. */ public static String preReleaseWithPrefix() { - return preReleaseWithPrefix(DEFAULT_PRERELEASE_PREFIX); + return preReleaseWithPrefix(PRERELEASE_PREFIX); } /** @@ -95,10 +95,10 @@ public final class {{className}} { * @return The pre-release version, if any. */ public static String preReleaseWithPrefix(final String prefix) { - if (preRelease.length() > 0 && prefix.length() > 0) { - return prefix + preRelease; + if (PRERELEASE.length() > 0 && prefix.length() > 0) { + return prefix + PRERELEASE; } else { - return preRelease; + return PRERELEASE; } } } \ No newline at end of file diff --git a/version.properties b/version.properties index 75c612b..b414f50 100644 --- a/version.properties +++ b/version.properties @@ -1,8 +1,8 @@ -#Mon, 25 Jan 2016 16:36:57 -0800 +#Mon, 17 Apr 2017 22:49:41 -0700 #Mon Dec 07 01:31:00 PST 2015 version.project=mobibot version.major=0 version.minor=7 -version.patch=0 +version.patch=1 version.prerelease=beta -version.buildmeta=018 +version.buildmeta=018 \ No newline at end of file