1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt-doc.git synced 2025-04-25 20:07:11 -07:00

Doc updates.

This commit is contained in:
Cedric Beust 2015-12-13 04:14:27 +04:00
parent 31969fa4dc
commit bd0625bf4c

View file

@ -100,9 +100,9 @@ val project = kotlinProject {
<pre class="brush:xml"> <pre class="brush:xml">
&lt;kobalt-plugin&gt; &lt;kobalt-plugin&gt;
&lt;name&gt;kobalt-line-count&lt;/name&gt; &lt;name&gt;kobalt-line-count&lt;/name&gt;
&lt;plugins&gt; &lt;plugin-actors&gt;
&lt;class-name&gt;com.beust.kobalt.plugin.linecount.LineCountPlugin&lt;/class-name&gt; &lt;class-name&gt;com.beust.kobalt.plugin.linecount.LineCountPlugin&lt;/class-name&gt;
&lt;/plugins&gt; &lt;/plugin-actors&gt;
&lt;/kobalt-plugin&gt; &lt;/kobalt-plugin&gt;
</pre> </pre>
@ -136,14 +136,14 @@ public class Main : BasePlugin() {
$ ./kobaltw uploadJcenter $ ./kobaltw uploadJcenter
... ...
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadJcenter
kobalt-line-count: Found 2 artifacts to upload Found 12 artifacts to upload:
All artifacts successfully uploaded Uploading 12 / 12 |............|
############# Time to Build: 3590 ms BUILD SUCCESSFUL (15 seconds)
</pre> </pre>
<p> <p>
If you go to the maven section of your bintray account, you will now see that the new package has two unpublished files. Your new plug-in won't be visible by clients until you publish those files, so let's update our build file to automatically publish files from now on: If you go to the maven section of your bintray account, you will now see that the new package has two unpublished files. Your new plug-in won't be visible by clients until you publish those files, so let's update our build file to automatically publish files from now on:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
jcenter { jcenter {
@ -200,15 +200,14 @@ Created /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count
========== kobalt-line-count:generatePom ========== kobalt-line-count:generatePom
Wrote /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.pom Wrote /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.pom
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadJcenter
kobalt-line-count: Found 2 artifacts to upload Found 12 artifacts to upload:
All artifacts successfully uploaded Uploading 12 / 12 |............|
BUILD SUCCESSFUL (15 seconds)
Time to Build: 5907 ms
</pre> </pre>
<p> <p>
Finally, let's use our plug-in from another project. Since we didn't link this project to JCenter, it's uploaded in the user's maven repository, so we will have to add this maven repository to the build file where we want to use the plug-in. Adjust this line to point to your own maven repo: Finally, let's use our plug-in from another project. Since we didn't link this project to JCenter, it's uploaded in the user's maven repository, so we will have to add this maven repository to the build file where we want to use the plug-in. Adjust this line to point to your own maven repo:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
val repos = repos("https://dl.bintray.com/cbeust/maven/") val repos = repos("https://dl.bintray.com/cbeust/maven/")
@ -241,7 +240,8 @@ Found 4972 lines in 65 files
</pre> </pre>
<p> <p>
And that's it! You can now iterate on your plug-in and upload it with additional <code>./kobaltw uploadJcenter</code>. This plug-in is <a href="https://github.com/cbeust/kobalt-linecount">available on github</a>. And that's it! You can now iterate on your plug-in and upload it with additional <code>./kobaltw uploadJcenter</code>. This plug-in is <a href="https://github.com/cbeust/kobalt-linecount">available on github</a>. Note that the plug-in in the repo
illustrates a few other concepts not discussed here, such as adding dynamic tasks, so I encourage you take a look at its source.
</p> </p>
<h2 class="section" id="initialization">Initialization</h2> <h2 class="section" id="initialization">Initialization</h2>