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

Document the java/kotlin templates.

This commit is contained in:
Cedric Beust 2016-02-27 19:56:35 -08:00
parent 1a398913b4
commit f08ef2d5ab

View file

@ -116,6 +116,51 @@ Once you have at least one project configured, the plug-in lets you invoke the f
<dd>Clean the project</dd> <dd>Clean the project</dd>
</dl> </dl>
<h3 class="section" id="templates" indent="1">Templates</h3>
<p>
Both the Java and Kotlin plug-ins provide templates named respectively "java" and "kotlin".
</p>
<pre class="brush:plain">
$ ./kobaltw --listTemplates
Available templates
Plug-in: Kobalt
"java" Generate a simple Java project
"kotlin" Generate a simple Kotlin project</pre>
<p>
They are both identical templates so we'll just look over the Kotlin one.
</p>
<p>
If you invoke <code>./kobaltw --init kotlin</code>, the following will happen:
</p>
<ul>
<li>If a <code>kobalt/src/Build.kt</code> build file doesn't exist, it will be created.</li>
<li>If no Kotlin (or Java) file is found under <code>src</code>, the template will create a simple
class with a <code>main</code> method and also a test class.</li>
</ul>
<pre class="brush:plain">
$ ./kobaltw --init kotlin
Template "kotlin" installed
Now you can run either `./kobaltw test` or `./kobaltw run`
$ ./kobaltw test
----- example:test
===============================================
Command line suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================
All tests passed
BUILD SUCCESSFUL (5 seconds)
$ ./kobaltw run
----- example:run
Hello Java world from Kobalt
BUILD SUCCESSFUL (0 seconds)
</pre>
<h3 class="section" id="variants" indent="1">Variants</h3> <h3 class="section" id="variants" indent="1">Variants</h3>
<p> <p>
Variants let you configure your project to generate different artifacts compiled from different sources depending on the <em>variant</em> you selected. Variants let you configure your project to generate different artifacts compiled from different sources depending on the <em>variant</em> you selected.