Skip to content

Commit

Permalink
implementation instead of compileOnly in Gradle/Kotlin too.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed May 25, 2019
1 parent 66a0fec commit 1367ae5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ var semverProcessor = "net.thauvin.erik:semver:1.2.0"
dependencies {
kapt(semverProcessor)
compileOnly(semverProcessor)
implementation (semverProcessor)
}
kapt {
Expand Down
26 changes: 16 additions & 10 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ <h2 id="table-of-contents">Table of Contents</h2>
<li><a href="#default-template">Default Template</a></li>
<li><a href="#custom-template">Custom Template</a></li>
</ul></li>
<li><a href="#elements---properties">Elements &amp; Properties</a></li>
<li><a href="#usage-with-maven--gradle--kotlin-and-kobalt">Usage with Maven, Gradle, Kotlin and Kobalt</a>
<li><a href="#elements--properties">Elements &amp; Properties</a></li>
<li><a href="#usage-with-maven-gradle-kotlin-and-kobalt">Usage with Maven, Gradle, Kotlin and Kobalt</a>
<ul>
<li><a href="#maven">Maven</a></li>
<li><a href="#gradle">Gradle</a>
<ul>
<li><a href="#class-generation">Class Generation</a></li>
<li><a href="#class---source-generation">Class &amp; Source Generation</a></li>
<li><a href="#class--source-generation">Class &amp; Source Generation</a></li>
</ul></li>
<li><a href="#kotlin">Kotlin</a>
<ul>
<li><a href="#kotlin---gradle">Kotlin &amp; Gradle</a></li>
<li><a href="#kotlin--gradle">Kotlin &amp; Gradle</a></li>
</ul></li>
<li><a href="#kobalt">Kobalt</a></li>
</ul></li>
Expand Down Expand Up @@ -436,13 +436,13 @@ <h3 id="maven">Maven</h3>
<a class="sourceLine" id="cb8-4" title="4"> <span class="kw">&lt;version&gt;</span>1.2.0<span class="kw">&lt;/version&gt;</span></a>
<a class="sourceLine" id="cb8-5" title="5"><span class="kw">&lt;/dependency&gt;</span></a></code></pre></div>
<p>Please look at <a href="https://github.com/ethauvin/semver/blob/master/examples/java/pom.xml">pom.xml</a> in the <a href="https://github.com/ethauvin/semver/tree/master/examples/java">Java example</a> directory for a sample:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" title="1"><span class="ex">mvn</span> compile exec:java</a></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" title="1"><span class="ex">mvn</span> verify</a></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 <code>build.gradle</code>:</p>
<pre class="gradle"><code>dependencies {
annotationProcessor &#39;net.thauvin.erik:semver:1.2.0&#39;
compileOnly &#39;net.thauvin.erik:semver:1.2.0&#39;
implementation &#39;net.thauvin.erik:semver:1.2.0&#39;
}
</code></pre>
<p>The <code>GeneratedVersion</code> class will be automatically created in the <code>build/generated</code> directory upon compiling.</p>
Expand All @@ -467,11 +467,17 @@ <h4 id="kotlin--gradle">Kotlin &amp; Gradle</h4>
<a class="sourceLine" id="cb13-2" title="2"></a>
<a class="sourceLine" id="cb13-3" title="3">dependencies {</a>
<a class="sourceLine" id="cb13-4" title="4"> kapt(semverProcessor)</a>
<a class="sourceLine" id="cb13-5" title="5"> compileOnly(semverProcessor)</a>
<a class="sourceLine" id="cb13-6" title="6">}</a></code></pre></div>
<p>As of <a href="https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/#more-6991">Kotlin 1.2.30</a>, when using <code>kapt</code> you must include the following in <code>gradle.properties</code>:</p>
<a class="sourceLine" id="cb13-5" title="5"> implementation (semverProcessor)</a>
<a class="sourceLine" id="cb13-6" title="6">}</a>
<a class="sourceLine" id="cb13-7" title="7"></a>
<a class="sourceLine" id="cb13-8" title="8">kapt {</a>
<a class="sourceLine" id="cb13-9" title="9"> arguments {</a>
<a class="sourceLine" id="cb13-10" title="10"> arg(<span class="st">&quot;semver.project.dir&quot;</span>, projectDir)</a>
<a class="sourceLine" id="cb13-11" title="11"> }</a>
<a class="sourceLine" id="cb13-12" title="12">}</a></code></pre></div>
<p>The arguments block is not required if <code>kapt</code> is configured to use the Gradle Worker API in <code>gradle.properties</code>:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode ini"><code class="sourceCode ini"><a class="sourceLine" id="cb14-1" title="1"><span class="dt">kapt.use.worker.api</span><span class="ot">=</span><span class="kw">true</span></a></code></pre></div>
<p>This option will likely be enabled by default in the future, but is currently not working under Java 10/11 see <a href="https://youtrack.jetbrains.net/issue/KT-26203">KT-26203</a>.</p>
<p>This option will likely be enabled by default in the future, but is currently not working under Java 10+ see <a href="https://youtrack.jetbrains.net/issue/KT-26203">KT-26203</a>.</p>
<p>Please look at the <a href="https://github.com/ethauvin/semver/tree/master/examples/kotlin">Kotlin example</a> project for a <a href="https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts">build.gradle.kts</a> sample.</p>
<h3 id="kobalt">Kobalt</h3>
<p>To install and run from <a href="https://beust.com/kobalt/">Kobalt</a>, add the following to <code>Build.kt</code>:</p>
Expand Down

0 comments on commit 1367ae5

Please sign in to comment.