Changed Version
to GeneratedVersion
This commit is contained in:
parent
4fdf165d8f
commit
4c66bf6299
3 changed files with 7 additions and 6 deletions
|
@ -49,7 +49,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="semantic-version-annotation-processor">Semantic Version Annotation Processor</h1>
|
<h1 id="semantic-version-annotation-processor">Semantic Version Annotation Processor</h1>
|
||||||
<p>An <a href="https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html">annotation processor</a> that automatically generates a <code>Version</code> class containing the <a href="http://semver.org/">semantic version</a> (major, minor, patch, etc.) that is read from a <code>Properties</code> file or defined in the <a href="https://docs.oracle.com/javase/tutorial/java/annotations/basics.html">annotation</a>.</p>
|
<p>An <a href="https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html">annotation processor</a> that automatically generates a <code>GeneratedVersion</code> class containing the <a href="http://semver.org/">semantic version</a> (major, minor, patch, etc.) that is read from a <code>Properties</code> file or defined in the <a href="https://docs.oracle.com/javase/tutorial/java/annotations/basics.html">annotation</a>.</p>
|
||||||
<p>This processor was inspired by Cédric Beust's <a href="https://github.com/cbeust/version-processor">version-processor</a>.</p>
|
<p>This processor was inspired by Cédric Beust's <a href="https://github.com/cbeust/version-processor">version-processor</a>.</p>
|
||||||
<h2 id="examples">Examples</h2>
|
<h2 id="examples">Examples</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -246,12 +246,14 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
||||||
<span class="kw"><version></span>0.9.1-beta<span class="kw"></version></span>
|
<span class="kw"><version></span>0.9.1-beta<span class="kw"></version></span>
|
||||||
<span class="kw"></dependency></span></code></pre></div>
|
<span class="kw"></dependency></span></code></pre></div>
|
||||||
<h3 id="gradle">Gradle</h3>
|
<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>
|
<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 {
|
<pre class="gradle"><code>dependencies {
|
||||||
compile 'net.thauvin.erik:semver:0.9.1-beta'
|
compile 'net.thauvin.erik:semver:0.9.1-beta'
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
<p>The <code>GeneratedVersion</code> class will be automatically generated in the <code>build</code> directory upon compiling.</p>
|
<p>The <code>GeneratedVersion</code> class will be automatically created in the <code>build</code> directory upon compiling.</p>
|
||||||
<p>In order to also include the generated source code to your source tree, you should 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>
|
<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 {
|
<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.2"
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
|
@ -261,7 +263,6 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
|
||||||
}
|
}
|
||||||
|
|
||||||
annotationProcessor {
|
annotationProcessor {
|
||||||
project.version = getVersion(isRelease)
|
|
||||||
library 'net.thauvin.erik:semver:0.9.1-beta'
|
library 'net.thauvin.erik:semver:0.9.1-beta'
|
||||||
processor 'net.thauvin.erik.semver.VersionProcessor'
|
processor 'net.thauvin.erik.semver.VersionProcessor'
|
||||||
// sourcesDir 'src/generated/java'
|
// sourcesDir 'src/generated/java'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Semantic Version Annotation Processor
|
# Semantic Version Annotation Processor
|
||||||
|
|
||||||
An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html) that automatically generates a `Version` class containing the [semantic version](http://semver.org/) (major, minor, patch, etc.) that is read from a `Properties` file or defined in the [annotation](https://docs.oracle.com/javase/tutorial/java/annotations/basics.html).
|
An [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html) that automatically generates a `GeneratedVersion` class containing the [semantic version](http://semver.org/) (major, minor, patch, etc.) that is read from a `Properties` file or defined in the [annotation](https://docs.oracle.com/javase/tutorial/java/annotations/basics.html).
|
||||||
|
|
||||||
This processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor).
|
This processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor).
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module external.linked.project.id="semver" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.9.0-beta" type="JAVA_MODULE" version="4">
|
<module external.linked.project.id="semver" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.9.1-beta" type="JAVA_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||||
<output url="file://$MODULE_DIR$/build/classes/main" />
|
<output url="file://$MODULE_DIR$/build/classes/main" />
|
||||||
<output-test url="file://$MODULE_DIR$/build/classes/test" />
|
<output-test url="file://$MODULE_DIR$/build/classes/test" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue