Getting ready for 1.2.0 release.

This commit is contained in:
Erik C. Thauvin 2019-04-01 01:51:57 -07:00
parent 45a90d1353
commit 55d2e9e0d7
11 changed files with 156 additions and 74 deletions

View file

@ -5,7 +5,7 @@ apply plugin: 'application'
defaultTasks 'run'
def semverProcessor = 'net.thauvin.erik:semver:1.1.1'
def semverProcessor = 'net.thauvin.erik:semver:1.2.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8

View file

@ -12,23 +12,23 @@ import java.util.Date;
* @author <a href="https://github.com/ethauvin/semver">Semantic Version Annotation Processor</a>
*/
public final class GeneratedVersion {
public final static String PRERELEASE_PREFIX = "-";
public final static String BUILDMETA_PREFIX = "+";
public final static String PROJECT = "Example";
public final static Date BUILDDATE = new Date(1554009013319L);
public final static Date BUILDDATE = new Date(1554108013631L);
public final static int MAJOR = 2;
public final static int MINOR = 17;
public final static int MINOR = 0;
public final static int PATCH = 52;
public final static String PRERELEASE = "beta";
public final static String PRERELEASE_PREFIX = "-";
public final static String BUILDMETA = "007";
public final static String BUILDMETA_PREFIX = "+";
public final static String SEPARATOR = "";
/**
* The full version string.
* <p>
* Formatted as:
* <blockquote>
* <code>MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA]</code>
* <code>[MAJOR][SEPARATOR][MINOR][SEPARATOR][PATCH][[PRERELEASE_PREFIX][PRERELEASE]][[BUILDMETA_PREFIX][BUILDMETA]]</code>
* </blockquote>
* <p>
* For example:
@ -39,10 +39,8 @@ public final class GeneratedVersion {
* <li><code>1.0.0-alpha+001</code></li>
* </ul>
*/
public final static String VERSION = Integer.toString(MAJOR) + '.'
+ Integer.toString(MINOR) + '.'
+ Integer.toString(PATCH)
+ preReleaseWithPrefix() + buildMetaWithPrefix();
public final static String VERSION = Integer.toString(MAJOR) + SEPARATOR + Integer.toString(MINOR) + SEPARATOR
+ Integer.toString(PATCH) + preReleaseWithPrefix() + buildMetaWithPrefix();
/**
* Disables the default constructor.
@ -70,7 +68,7 @@ public final class GeneratedVersion {
* @return The build metadata, if any.
*/
public static String buildMetaWithPrefix(final String prefix) {
if (BUILDMETA.length() > 0 && prefix.length() > 0) {
if (BUILDMETA.length() > 0) {
return prefix + BUILDMETA;
} else {
return BUILDMETA;
@ -93,10 +91,10 @@ public final class GeneratedVersion {
* @return The pre-release version, if any.
*/
public static String preReleaseWithPrefix(final String prefix) {
if (PRERELEASE.length() > 0 && prefix.length() > 0) {
if (PRERELEASE.length() > 0) {
return prefix + PRERELEASE;
} else {
return PRERELEASE;
}
}
}
}

View file

@ -2,7 +2,7 @@
#Sat Mar 30 15:48:08 PDT 2019
version.buildmeta=007
version.major=2
version.minor=17
version.minor=0
version.patch=52
version.prerelease=beta
version.project=Example