ScriptCommandLauncher (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.launcher, class: ScriptCommandLauncher

# Class ScriptCommandLauncher

java.lang.Object
org.apache.tools.ant.taskdefs.launcher.CommandLauncher
org.apache.tools.ant.taskdefs.launcher.CommandLauncherProxy
org.apache.tools.ant.taskdefs.launcher.ScriptCommandLauncher

public class ScriptCommandLauncher extends CommandLauncherProxy
A command launcher that uses an auxiliary script to launch commands in directories other than the current working directory.

- ## Field Summary

  ### Fields inherited from class CommandLauncher

  `FILE_UTILS`
  Modifier and Type
  Field
  Description
  `protected static final FileUtils`
  `FILE_UTILS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScriptCommandLauncher(String script, CommandLauncher launcher)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Process`
  `exec(Project project, String[] cmd, String[] env, File workingDir)`
  Launches the given command in a new process, in the given working directory.

  ### Methods inherited from class CommandLauncherProxy

  `exec`
  Modifier and Type
  Method
  Description
  `Process`
  `exec(Project project, String[] cmd, String[] env)`
  Launches the given command in a new process.

  ### Methods inherited from class CommandLauncher

  `getShellLauncher, getVMLauncher, setShellLauncher, setVMLauncher`
  Modifier and Type
  Method
  Description
  `static CommandLauncher`
  `getShellLauncher(Project project)`
  Obtains the shell launcher configured for the given project or the default shell launcher.
  `static CommandLauncher`
  `getVMLauncher(Project project)`
  Obtains the VM launcher configured for the given project or the default VM launcher.
  `static void`
  `setShellLauncher(Project project, CommandLauncher launcher)`
  Sets the shell launcher to use for the given project.
  `static void`
  `setVMLauncher(Project project, CommandLauncher launcher)`
  Sets the VM launcher to use for the given project.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ScriptCommandLauncher

    public ScriptCommandLauncher(String script, CommandLauncher launcher)

- ## Method Details

  - ### exec

    public Process exec(Project project, String[] cmd, String[] env, File workingDir) throws IOException
    Launches the given command in a new process, in the given working directory.
    Overrides:
      `exec` in class `CommandLauncher`
    Parameters:
      `project` - the Ant project.
      `cmd` - the command line to execute as an array of strings.
      `env` - the environment to set as an array of strings.
      `workingDir` - working directory where the command should run.
    Returns:
      the created Process.
    Throws:
      `IOException` - forwarded from the exec method of the command launcher.