public class CopyJarsUsingProductFile extends DefaultTask
THIS CLASS IS EXPERIMENTAL AND SUBJECT TO CHANGE.
Copies jars into a folder, using a product file and an ExplicitVersionPolicy
to decide which jars to copy. Useful for passing jars to analysis tools.
task copyJars(type: CopyJarsUsingProductFile) {
// uses jars from the given folders / installations
from TARGETMAVEN_PLUGINS_DIR
from TARGETP2_RUNNABLE_DIR
// uses the given product file to determine which jars to copy
productFile rootProject.file('com.diffplug.rcpdemo/rcpdemo.product')
// adds plugins which aren't included by the productFile
extra('org.jsr-305')
// destination for the copied jars
into COPY_PRODUCT_JARS
// determines which version to use when multiple versions are available
explicitVersionPolicy {
resolve('com.jcraft.jsch', '0.1.53.autowrapped', '0.1.53.v201508180515').withFirst()
resolve('org.apache.commons.codec', '1.6.0', '1.6.0.v201305230611').withFirst()
resolve('org.apache.commons.logging', '1.1.3', '1.1.1.v201101211721').withFirst()
resolve('org.apache.httpcomponents.httpclient', '4.3.6.autowrapped', '4.3.6.v201411290715').withFirst()
resolve('org.apache.httpcomponents.httpcore', '4.3.3.autowrapped', '4.3.3.v201411290715').withFirst()
resolve('org.hamcrest.core', '1.3.0.autowrapped', '1.3.0.v201303031735').withFirst()
resolve('org.tukaani.xz', '1.4.0', '1.3.0.v201308270617').withFirst()
}
}
Task.Namer
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
CopyJarsUsingProductFile() |
Modifier and Type | Method and Description |
---|---|
void |
action() |
void |
explicitVersionPolicy(Action<ExplicitVersionPolicy> action) |
void |
extra(String extra) |
void |
from(Object from) |
void |
into(Object dest) |
void |
productFile(Object file) |
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toString
public void from(Object from)
public void productFile(Object file)
public void explicitVersionPolicy(Action<ExplicitVersionPolicy> action)
public void into(Object dest)
public void extra(String extra)
public void action() throws IOException
IOException