public class CmdLineTask extends DefaultTask
A task for running a series of actions, including shell commands.
task mirrorRepo(type: com.diffplug.gradle.CmdLineTask) {
// initialize the repository
cmd("svnadmin create ${name}")
// setup its script
copy(SCRIPT, "${name}/hooks/${SCRIPT}")
// initialize the sync
cmd("svnsync initialize file:///${project.file(name).absolutePath} ${url}")
// follow throw on the sync
cmd("svnsync synchronize file:///${project.file(name).absolutePath} ${url}")
}
Task.NamerTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor and Description |
|---|
CmdLineTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanDir(Object dir) |
void |
cmd(Object directory,
String cmd)
Sets the working directory to the given dir, then executes the given command.
|
void |
cmd(String cmd)
Executes the given command.
|
void |
copy(Object src,
Object dst)
Removes the given file or directory.
|
void |
mv(Object src,
Object dst)
Removes the given file or directory.
|
void |
performActions() |
void |
rm(Object fileOrDir)
Removes the given file or directory.
|
void |
run(groovy.lang.Closure<?> action)
Removes the given file or directory.
|
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceappendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoNotTrackState, getConvention, notCompatibleWithConfigurationCachepublic void cleanDir(Object dir)
public void cmd(String cmd)
Executes the given command.
public void cmd(Object directory, String cmd)
Sets the working directory to the given dir, then executes the given command.
public void rm(Object fileOrDir)
Removes the given file or directory.
public void run(groovy.lang.Closure<?> action)
Removes the given file or directory.