mirror of
https://github.com/ethauvin/kobalt-doc.git
synced 2025-04-25 12:07:10 -07:00
Syntax doc.
This commit is contained in:
parent
2ddd3e86cd
commit
cd49baeaab
1 changed files with 28 additions and 0 deletions
|
@ -129,6 +129,34 @@ Here are a few noteworthy details about this small build file:
|
||||||
<li>The functions <code>kotlinProject</code> and <code>homeDir</code> are supplied by Kobalt and are referred to as "directives"
|
<li>The functions <code>kotlinProject</code> and <code>homeDir</code> are supplied by Kobalt and are referred to as "directives"
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
In terms of syntax, there are basically three different ways to specify values in a build file:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Individual values for primitives (numbers, strings) are a straight equals sign:
|
||||||
|
<pre>
|
||||||
|
name = "kobalt"</pre>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
Parameters that can receive multiple values are usually captured by function calls, so you use parentheses, as usual in Kotlin:
|
||||||
|
<pre>
|
||||||
|
compile("dep1", "dep2", "dep2")</pre>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
Complex objects are passed as closures, so you use curly braces to define them:
|
||||||
|
<pre>
|
||||||
|
dependencies {
|
||||||
|
...
|
||||||
|
}</pre>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Remember that a build file is a valid Kotlin source, so you can use function calls instead of literal values, or any other correct Kotlin code in your build file:
|
||||||
|
</p>
|
||||||
|
<pre>
|
||||||
|
version = readVersion()</pre>
|
||||||
<h3 class="section" indent="1" id="directives">Directives</h3>
|
<h3 class="section" indent="1" id="directives">Directives</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue