From 4248eab785fe02960df381b41c6f02c7f31b65cb Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 6 Apr 2017 10:32:15 -0700 Subject: [PATCH] Clarify the install doc. --- plug-ins/index.html | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/plug-ins/index.html b/plug-ins/index.html index e3ca420..f5bc296 100644 --- a/plug-ins/index.html +++ b/plug-ins/index.html @@ -474,29 +474,48 @@ assemble {

install

- The install section lets you specify how the artifacts get installed. If you don't specify any install directive, then the install task will install your artifacts in the lib directory by default. + The install section lets you specify how the artifacts get installed. There are two mutually exclusive + ways to use install.

-

- The simplest configuration is to copy all the artifacts created to a directory: + +

Bulk install

+ +

+ The simplest way to install is either not specify anything in the install directive or an optional + target string, which specifies the target directory ("libs" by default):

     install {
-        libDir = "libs"
+        target = "libs"
     }
 
+

+ With this approach, everything that was generated in kobaltBuild/libs gets copied to this + target directory. +

-

+

Fine grained install

+ +

You can also be more selective in what you install with either the copy directive to copy individual files or with include, which lets you specify more sophisticated ways of moving files to a destination:

     install {
-        copy("README", to("deploy"))
+        copy(from("README"), to("deploy"))
         include(from("kobaltBuild/libs"), to("deploy"), glob("**/*"))
     }
 
-

+ +

+

Note

+ 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 target approach will + be ignored. +
+ +

You might find the directive collect() 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: