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

Clarify the install doc.

This commit is contained in:
Cedric Beust 2017-04-06 10:32:15 -07:00
parent 8d404fd023
commit 4248eab785

View file

@ -474,16 +474,27 @@ assemble {
<h2 class="section" id="install" indent="1">install</h2> <h2 class="section" id="install" indent="1">install</h2>
<p> <p>
The <code>install</code> section lets you specify how the artifacts get installed. If you don't specify any <code>install</code> directive, then the <code>install</code> task will install your artifacts in the <code>lib</code> directory by default. The <code>install</code> section lets you specify how the artifacts get installed. There are two mutually exclusive
ways to use <code>install</code>.
</p> </p>
<h3 class="section" id="install-target" indent="1">Bulk install</h3>
<p> <p>
The simplest configuration is to copy all the artifacts created to a directory: The simplest way to install is either not specify anything in the <code>install</code> directive or an optional
<code>target</code> string, which specifies the target directory (<code>"libs"</code> by default):
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
install { install {
libDir = "libs" target = "libs"
} }
</pre> </pre>
<p>
With this approach, everything that was generated in <code>kobaltBuild/libs</code> gets copied to this
target directory.
</p>
<h3 class="section" id="install-include" indent="1">Fine grained install</h3>
<p> <p>
You can also be more selective in what you install with either the <code>copy</code> directive to copy You can also be more selective in what you install with either the <code>copy</code> directive to copy
@ -492,10 +503,18 @@ assemble {
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
install { install {
copy("README", to("deploy")) copy(from("README"), to("deploy"))
include(from("kobaltBuild/libs"), to("deploy"), glob("**/*")) include(from("kobaltBuild/libs"), to("deploy"), glob("**/*"))
} }
</pre> </pre>
<div class="bs-callout bs-callout-warning">
<h4>Note</h4>
These two approaches are mutually exclusive: if you choose the fine grained approach, you will have to
perform the installation of all the artifacts yourself and the <code>target</code> approach will
be ignored.
</div>
<p> <p>
You might find the directive <code>collect()</code> useful when installing: this function is invoked on a You might find the directive <code>collect()</code> useful when installing: this function is invoked on a
list of dependencies and returns a list of jar files that represent the transitive closure of the dependencies: list of dependencies and returns a list of jar files that represent the transitive closure of the dependencies: