Updated gradle build files with new syntax, etc.
This commit is contained in:
parent
5562a693a9
commit
3001a4f8f0
5 changed files with 34 additions and 30 deletions
16
README.html
16
README.html
|
@ -217,7 +217,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
|||
</table>
|
||||
<p>In order to easily incorporate with existing projects, the property keys may be assigned custom values:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode java"><code class="sourceCode java"><span class="fu">@Version</span>(
|
||||
properties = <span class="st">"example.properties"</span>,
|
||||
properties = <span class="st">"example.properties"</span>,
|
||||
majorKey = <span class="st">"example.major"</span>,
|
||||
minorKey = <span class="st">"example.minor"</span>,
|
||||
patchKey = <span class="st">"example.patch"</span>,
|
||||
|
@ -239,27 +239,27 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
|||
<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw"><dependency></span>
|
||||
<span class="kw"><groupId></span>net.thauvin.erik<span class="kw"></groupId></span>
|
||||
<span class="kw"><artifactId></span>semver<span class="kw"></artifactId></span>
|
||||
<span class="kw"><version></span>0.9.7<span class="kw"></version></span>
|
||||
<span class="kw"><version></span>0.9.6-beta<span class="kw"></version></span>
|
||||
<span class="kw"></dependency></span></code></pre></div>
|
||||
<h3 id="gradle">Gradle</h3>
|
||||
<h4 id="class-generation">Class Generation</h4>
|
||||
<p>To install and run from <a href="https://gradle.org/">Gradle</a>, add the following to the <code>build.gradle</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.7'
|
||||
compile 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
}</code></pre>
|
||||
<p>The <code>GeneratedVersion</code> class will be automatically created in the <code>build</code> directory upon compiling.</p>
|
||||
<h4 id="class-source-generation">Class & Source Generation</h4>
|
||||
<p>In order to also incorporate the generated source code into the <code>source tree</code>, use the <a href="https://github.com/ewerk/gradle-plugins/tree/master/plugins/annotation-processor-plugin">EWERK Annotation Processor Plugin</a>. Start by addding the following to the very top of the <code>build.gradle</code> file:</p>
|
||||
<pre class="gradle"><code>plugins {
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.3"
|
||||
}</code></pre>
|
||||
<p>Then add the following to the <code>build.gradle</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
compileOnly 'net.thauvin.erik:semver:0.9.7'
|
||||
compileOnly 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
library 'net.thauvin.erik:semver:0.9.7'
|
||||
library 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// sourcesDir 'src/generated/java'
|
||||
}
|
||||
|
@ -273,8 +273,8 @@ compileJava {
|
|||
<h3 id="kobalt">Kobalt</h3>
|
||||
<p>To install and run from <a href="http://beust.com/kobalt/">Kobalt</a>, add the following to the <code>Build.kt</code> file:</p>
|
||||
<pre class="gradle"><code>dependencies {
|
||||
apt("net.thauvin.erik:semver:0.9.7")
|
||||
compile("net.thauvin.erik:semver:0.9.7")
|
||||
apt("net.thauvin.erik:semver:0.9.6-beta")
|
||||
compile("net.thauvin.erik:semver:0.9.6-beta")
|
||||
}</code></pre>
|
||||
<p>Please look at the <a href="https://github.com/ethauvin/semver/blob/master/example/kobalt/src/Build.kt">Build.kt</a> file in the <a href="https://github.com/ethauvin/semver/tree/master/example">example</a> module directory for a sample.</p>
|
||||
<h3 id="auto-increment">Auto-Increment</h3>
|
||||
|
|
20
README.md
20
README.md
|
@ -7,7 +7,7 @@ An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annota
|
|||
This processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor).
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
* Using annotation elements:
|
||||
|
||||
```java
|
||||
|
@ -80,7 +80,7 @@ public final class ${className} {
|
|||
The Velocity variables are automatically filled in by the processor.
|
||||
|
||||
Please also look at this [example](https://github.com/ethauvin/mobibot/blob/master/version.vm) using [`java.time`](https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html)
|
||||
|
||||
|
||||
## Elements & Properties
|
||||
|
||||
The following annotation elements and properties are available:
|
||||
|
@ -101,7 +101,7 @@ In order to easily incorporate with existing projects, the property keys may be
|
|||
|
||||
```java
|
||||
@Version(
|
||||
properties = "example.properties",
|
||||
properties = "example.properties",
|
||||
majorKey = "example.major",
|
||||
minorKey = "example.minor",
|
||||
patchKey = "example.patch",
|
||||
|
@ -131,7 +131,7 @@ To install and run from [Maven](http://maven.apache.org/), configure an artifact
|
|||
<dependency>
|
||||
<groupId>net.thauvin.erik</groupId>
|
||||
<artifactId>semver</artifactId>
|
||||
<version>0.9.7</version>
|
||||
<version>0.9.6-beta</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
@ -143,7 +143,7 @@ To install and run from [Gradle](https://gradle.org/), add the following to the
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
compile 'net.thauvin.erik:semver:0.9.7'
|
||||
compile 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -155,7 +155,7 @@ In order to also incorporate the generated source code into the `source tree`, u
|
|||
|
||||
```gradle
|
||||
plugins {
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.3"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -163,11 +163,11 @@ Then add the following to the `build.gradle` file:
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
compileOnly 'net.thauvin.erik:semver:0.9.7'
|
||||
compileOnly 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
library 'net.thauvin.erik:semver:0.9.7'
|
||||
library 'net.thauvin.erik:semver:0.9.6-beta'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// sourcesDir 'src/generated/java'
|
||||
}
|
||||
|
@ -188,8 +188,8 @@ To install and run from [Kobalt](http://beust.com/kobalt/), add the following to
|
|||
|
||||
```gradle
|
||||
dependencies {
|
||||
apt("net.thauvin.erik:semver:0.9.7")
|
||||
compile("net.thauvin.erik:semver:0.9.7")
|
||||
apt("net.thauvin.erik:semver:0.9.6-beta")
|
||||
compile("net.thauvin.erik:semver:0.9.6-beta")
|
||||
}
|
||||
```
|
||||
|
||||
|
|
10
build.gradle
10
build.gradle
|
@ -193,10 +193,12 @@ task wrapper(type: Wrapper) {
|
|||
gradleVersion = gradle.gradleVersion
|
||||
}
|
||||
|
||||
task release(dependsOn: ['wrapper', 'clean', 'deploy']) << {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
task release(dependsOn: ['wrapper', 'clean', 'deploy']) {
|
||||
doLast {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
}
|
||||
}
|
||||
|
||||
task pandoc(type: Exec) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2"
|
||||
id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.3"
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
|
@ -45,13 +45,13 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'net.thauvin.erik:semver:0.9.7'
|
||||
compileOnly 'net.thauvin.erik:semver:+'
|
||||
}
|
||||
|
||||
annotationProcessor {
|
||||
// Update version, increment on release.
|
||||
project.version = getVersion(isRelease)
|
||||
library 'net.thauvin.erik:semver:0.9.7'
|
||||
library 'net.thauvin.erik:semver:+'
|
||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||
// sourcesDir 'src/generated/java'
|
||||
}
|
||||
|
@ -81,10 +81,12 @@ task deploy(dependsOn: ['build', 'copyToDeploy']) {
|
|||
mustRunAfter clean
|
||||
}
|
||||
|
||||
task release(dependsOn: ['wrapper', 'clean', 'deploy']) << {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
task release(dependsOn: ['wrapper', 'clean', 'deploy']) {
|
||||
doLast {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
isRelease = true
|
||||
}
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Date;
|
|||
*/
|
||||
public final class GeneratedVersion {
|
||||
private final static String buildmeta = "";
|
||||
private final static Date date = new Date(1468888435317L);
|
||||
private final static Date date = new Date(1490396459441L);
|
||||
private final static int major = 3;
|
||||
private final static int minor = 1;
|
||||
private final static int patch = 49;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue