diff --git a/README.html b/README.html index 6ca6fdf..2d3a009 100644 --- a/README.html +++ b/README.html @@ -236,6 +236,51 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf example.major=1 example.minor=0 example.patch=0 -... +# ... +

Usage with Maven, Grail and Kobalt

+

Maven

+

To install and run from Maven, configure an artifact as follows:

+
<dependency>
+    <groupId>net.thauvin.erik</groupId>
+    <artifactId>semver</artifactId>
+    <version>0.9.1-beta</version>
+</dependency>
+

Gradle

+

To install and run from Gradle, add the following to the build.gradle file:

+
dependencies {
+    compile 'net.thauvin.erik:semver:0.9.1-beta'
+}
+

The GeneratedVersion class will be automatically generated in the build directory upon compiling.

+

In order to also include the generated source code to your source tree, you should use the EWERK Annotation Processor Plugin. Start by addding the following to the very top of the build.gradle file:

+
plugins {
+    id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
+}
+

Then add the following to the build.gradle file:

+
dependencies {
+    compile 'net.thauvin.erik:semver:0.9.1-beta'
+}
+
+annotationProcessor {
+    project.version = getVersion(isRelease)
+    library 'net.thauvin.erik:semver:0.9.1-beta'
+    processor 'net.thauvin.erik.semver.VersionProcessor'
+    // sourcesDir 'src/generated/java'
+}
+
+compileJava {
+    // Disable the classpath procesor
+    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.

+

Kobalt

+

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

+
dependencies {
+    apt("net.thauvin.erik:semver:0.9.1-beta")
+}
+

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:

+
gradle clean release run
diff --git a/build.gradle b/build.gradle index e753d57..eb34b76 100644 --- a/build.gradle +++ b/build.gradle @@ -40,11 +40,10 @@ version = getVersion() def deployDir = 'deploy' def isRelease = 'release' in gradle.startParameter.taskNames - def mavenGroupId = 'net.thauvin.erik' def mavenName = 'SemVer' def mavenDescription = 'Semantic Version Annotation Processor' -def mavenUrl = 'https://github.com/ethauvin/sermver' +def mavenUrl = 'https://github.com/ethauvin/semver' def mavenLicense = 'The BSD 3-Clause License' def mavenLicenseUrl = 'http://opensource.org/licenses/BSD-3-Clause' def mavenScmCon = 'https://github.com/ethauvin/semver.git' @@ -70,7 +69,7 @@ bintray { user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') publications = ['MyPublication'] - dryRun = true + dryRun = false pkg { repo = 'maven' name = mavenName diff --git a/example/build.gradle b/example/build.gradle index ea8ebb3..f252bac 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -51,7 +51,7 @@ dependencies { annotationProcessor { project.version = getVersion(isRelease) - library 'net.thauvin.erik:semver:+' + library 'net.thauvin.erik:semver:0.9.1-beta' processor 'net.thauvin.erik.semver.VersionProcessor' } diff --git a/version.properties b/version.properties index 17ec74b..b69bd95 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ -#Sat, 23 Jan 2016 18:15:23 -0800 +#Sun, 24 Jan 2016 23:55:10 -0800 version.major=0 version.minor=9 -version.patch=0 +version.patch=1 version.buildmeta= version.prerelease=beta