diff --git a/README.html b/README.html index 1f56b8f..5aa8959 100644 --- a/README.html +++ b/README.html @@ -6,83 +6,60 @@
An annotation processor that automatically generates a GeneratedVersion
class containing the semantic version (major, minor, patch, etc.) that is read from a Properties
file or defined in the annotation.
This processor was inspired by Cédric Beust's version-processor.
@Version(major = 1, minor = 0, patch = 0, prerelease = "beta")
+@Version(major = 1, minor = 0, patch = 0, prerelease = "beta")
public class A {
-// ...
@Version(properties = "version.properties")
+@Version(properties = "version.properties")
public class A {
-// ...
# version.properties
+// ...
+# version.properties
version.major=1
version.minor=0
version.patch=0
-version.prerelease=beta
Upon running the annotator processor, a source file GeneratedVersion.java
is automatically generated with static methods to access the semantic version data. The source is based on a fully customizable Velocity template.
@Version(template = "myversion.vm")
+@Version(template = "myversion.vm")
public class A {
-// ...
The default template implements the following static methods:
-Method | @@ -135,7 +112,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
---|
A very simple custom template might look something like:
-/* myversion.vm */
+/* myversion.vm */
package ${packageName}
import java.util.Date;
@@ -148,17 +125,11 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
public final static int PATCH = ${patch};
public final static String PRERELEASE = "${prerelease}";
public final static String PROJECT = "${project}";
-}
The Velocity variables are automatically filled in by the processor.
The following annotation elements and properties are available:
-Element | @@ -221,7 +192,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
---|
In order to easily incorporate with existing projects, the property keys may be assigned custom values:
-@Version(
+@Version(
properties = "example.properties",
majorKey = "example.major",
minorKey = "example.minor",
@@ -231,21 +202,21 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
projectKey = "example.project"
)
public class Example {
-// ...
# example.properties
+// ...
+# example.properties
example.project=Example
example.major=1
example.minor=0
example.patch=0
-# ...
To install and run from Maven, configure an artifact as follows:
-<dependency>
+<dependency>
<groupId>net.thauvin.erik</groupId>
<artifactId>semver</artifactId>
<version>0.9.5-beta</version>
-</dependency>
To install and run from Gradle, add the following to the build.gradle
file: