Class CmdLineTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.diffplug.gradle.CmdLineTask
All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, org.gradle.util.Configurable<Task>

public class CmdLineTask extends DefaultTask
A task for running a series of actions, including shell commands. ```groovy 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}") } ```
  • Constructor Details

    • CmdLineTask

      public CmdLineTask()
  • Method Details

    • cleanDir

      public void cleanDir(Object dir)
    • cmd

      public void cmd(String cmd)
      Executes the given command.
    • cmd

      public void cmd(Object directory, String cmd)
      Sets the working directory to the given dir, then executes the given command.
    • rm

      public void rm(Object fileOrDir)
      Removes the given file or directory.
    • copy

      public void copy(Object src, Object dst)
      Removes the given file or directory.
    • mv

      public void mv(Object src, Object dst)
      Removes the given file or directory.
    • run

      public void run(groovy.lang.Closure<?> action)
      Removes the given file or directory.
    • performActions

      public void performActions() throws Throwable
      Throws:
      Throwable