diff --git a/README.html b/README.html index 4f03c05..bf0e958 100644 --- a/README.html +++ b/README.html @@ -76,7 +76,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf public class A { // ...

Default Template

-

The default template implements the following static methods:

+

The default template implements the following static methods:

@@ -274,7 +274,7 @@ compileJava { options.compilerArgs << '-proc:none' }

The plugin implements a separate compile task that only runs the annotation processor and is executed during the build phase.

-

Please look at the build.gradle file in the example module directory for a sample.

+

Please look at the build.gradle file in the example module directory for a sample.

Kobalt

To install and run from Kobalt, add the following to the Build.kt file:

dependencies {
@@ -282,7 +282,7 @@ compileJava {
 }

Auto-Increment

Incrementing the version is best left to your favorite build system.

-

For a solution using Gradle, please have a look at the build.gradle file in the example module directory. To run the example with patch version auto-incrementing, issue the following command:

+

For a solution using Gradle, please have a look at the build.gradle file in the example module directory. To run the example with patch version auto-incrementing, issue the following command:

gradle clean release run
diff --git a/build.gradle b/build.gradle index 3852ab7..34193ce 100644 --- a/build.gradle +++ b/build.gradle @@ -219,4 +219,4 @@ task pandoc(type: Exec) { ext.output = { return standardOutput.toString() } -} \ No newline at end of file +} diff --git a/example/src/generated/java/net/thauvin/erik/semver/example/GeneratedVersion.java b/example/src/generated/java/net/thauvin/erik/semver/example/GeneratedVersion.java index aa8a26c..8389dfa 100644 --- a/example/src/generated/java/net/thauvin/erik/semver/example/GeneratedVersion.java +++ b/example/src/generated/java/net/thauvin/erik/semver/example/GeneratedVersion.java @@ -115,7 +115,7 @@ public final class GeneratedVersion { return ""; } - + /** * Disables the default constructor. * diff --git a/semver.iml b/semver.iml index 5dc3d56..ad4fff5 100644 --- a/semver.iml +++ b/semver.iml @@ -1,5 +1,5 @@ - + diff --git a/semver.ipr b/semver.ipr index f4eaff3..4396551 100644 --- a/semver.ipr +++ b/semver.ipr @@ -305,7 +305,7 @@ - diff --git a/src/main/resources/version.vm b/src/main/resources/version.vm index 23da53b..78cfdb5 100644 --- a/src/main/resources/version.vm +++ b/src/main/resources/version.vm @@ -20,109 +20,109 @@ public final class ${className} { private final static String prerelease = "${prerelease}"; private final static String project = "${project}"; - /** - * Returns the build date. - * - * @return The build date. - */ - public static Date getBuildDate() { - return date; - } + /** + * Disables the default constructor. + * + * @throws UnsupportedOperationException if the constructor is called. + */ + private GeneratedVersion() + throws UnsupportedOperationException { + throw new UnsupportedOperationException("Illegal constructor call."); + } - /** - * Returns the full version string. - *

- * Formatted as: - *

- * MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA] - *
- *

- * For example: - *

    - *
  • 1.0.0
  • - *
  • 1.0.0-beta
  • - *
  • 1.0.0+20160124144700
  • - *
  • 1.0.0-alpha+001
  • - *
- * - * @return The version string. - */ - public static String getVersion() { - return Integer.toString(getMajor()) + '.' - + Integer.toString(getMinor()) + '.' - + Integer.toString(getPatch()) - + getPreRelease() + getBuildMetadata(); - } + /** + * Returns the build date. + * + * @return The build date. + */ + public static Date getBuildDate() { + return date; + } - /** - * Returns the major version. - * - * @return The major version. - */ - public static int getMajor() { - return major; - } + /** + * Returns the project name. + * + * @return The project name, if any. + */ + public static String getProject() { + return project; + } - /** - * Returns the minor version. - * - * @return The minor version. - */ - public static int getMinor() { - return minor; - } + /** + * Returns the full version string. + *

+ * Formatted as: + *

+ * MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA] + *
+ *

+ * For example: + *

    + *
  • 1.0.0
  • + *
  • 1.0.0-beta
  • + *
  • 1.0.0+20160124144700
  • + *
  • 1.0.0-alpha+001
  • + *
+ * + * @return The version string. + */ + public static String getVersion() { + return Integer.toString(getMajor()) + '.' + + Integer.toString(getMinor()) + '.' + + Integer.toString(getPatch()) + + getPreRelease() + getBuildMetadata(); + } - /** - * Returns the patch version. - * - * @return The patch version. - */ - public static int getPatch() { - return patch; - } + /** + * Returns the major version. + * + * @return The major version. + */ + public static int getMajor() { + return major; + } - /** - * Returns the pre-release version. - * - * @return The pre-release version, if any. - */ - public static String getPreRelease() { - if (prerelease.length() > 0) { - return '-' + prerelease; - } + /** + * Returns the minor version. + * + * @return The minor version. + */ + public static int getMinor() { + return minor; + } - return ""; - } + /** + * Returns the patch version. + * + * @return The patch version. + */ + public static int getPatch() { + return patch; + } - /** - * Returns the project name. - * - * @return The project name, if any. - */ - public static String getProject() { - return project; - } + /** + * Returns the pre-release version. + * + * @return The pre-release version, if any. + */ + public static String getPreRelease() { + if (prerelease.length() > 0) { + return '-' + prerelease; + } - /** - * Returns the build metadata. - * - * @return The build metadata, if any. - */ - public static String getBuildMetadata() { - if (buildmeta.length() > 0) { - return '+' + buildmeta; - } + return ""; + } - return ""; - } - - /** - * Disables the default constructor. - * - * @throws UnsupportedOperationException if the constructor is called. - */ - private ${className}() - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Illegal constructor call."); - } + /** + * Returns the build metadata. + * + * @return The build metadata, if any. + */ + public static String getBuildMetadata() { + if (buildmeta.length() > 0) { + return '+' + buildmeta; + } + + return ""; + } } \ No newline at end of file