Class CommandLauncher
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.launcher.CommandLauncher
 
- 
- Direct Known Subclasses:
- CommandLauncherProxy,- Java13CommandLauncher
 
 public class CommandLauncher extends java.lang.ObjectA command launcher for a particular JVM/OS platform. This class is a general purpose command launcher which can only launch commands in the current working directory.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static FileUtilsFILE_UTILS
 - 
Constructor SummaryConstructors Constructor Description CommandLauncher()
 - 
Method SummaryModifier and Type Method Description java.lang.Processexec(Project project, java.lang.String[] cmd, java.lang.String[] env)Launches the given command in a new process.java.lang.Processexec(Project project, java.lang.String[] cmd, java.lang.String[] env, java.io.File workingDir)Launches the given command in a new process, in the given working directory.static CommandLaunchergetShellLauncher(Project project)Obtains the shell launcher configured for the given project or the default shell launcher.static CommandLaunchergetVMLauncher(Project project)Obtains the VM launcher configured for the given project or the default VM launcher.static voidsetShellLauncher(Project project, CommandLauncher launcher)Sets the shell launcher to use for the given project.static voidsetVMLauncher(Project project, CommandLauncher launcher)Sets the VM launcher to use for the given project.
 
- 
- 
- 
Field Detail- 
FILE_UTILSprotected static final FileUtils FILE_UTILS 
 
- 
 - 
Method Detail- 
execpublic java.lang.Process exec(Project project, java.lang.String[] cmd, java.lang.String[] env) throws java.io.IOException Launches the given command in a new process.- Parameters:
- project- The project that the command is part of.
- cmd- The command to execute.
- env- The environment for the new process. If null, the environment of the current process is used.
- Returns:
- the created Process.
- Throws:
- java.io.IOException- if attempting to run a command in a specific directory.
 
 - 
execpublic java.lang.Process exec(Project project, java.lang.String[] cmd, java.lang.String[] env, java.io.File workingDir) throws java.io.IOException Launches the given command in a new process, in the given working directory.- Parameters:
- project- The project that the command is part of.
- cmd- The command to execute.
- env- The environment for the new process. If null, the environment of the current process is used.
- workingDir- The directory to start the command in. If null, the current directory is used.
- Returns:
- the created Process.
- Throws:
- java.io.IOException- if trying to change directory.
 
 - 
getShellLauncherpublic static CommandLauncher getShellLauncher(Project project) Obtains the shell launcher configured for the given project or the default shell launcher.- Parameters:
- project- Project
- Returns:
- CommandLauncher
 
 - 
getVMLauncherpublic static CommandLauncher getVMLauncher(Project project) Obtains the VM launcher configured for the given project or the default VM launcher.- Parameters:
- project- Project
- Returns:
- CommandLauncher
 
 - 
setVMLauncherpublic static void setVMLauncher(Project project, CommandLauncher launcher) Sets the VM launcher to use for the given project.- Parameters:
- project- Project
- launcher- CommandLauncher
 
 - 
setShellLauncherpublic static void setShellLauncher(Project project, CommandLauncher launcher) Sets the shell launcher to use for the given project.- Parameters:
- project- Project
- launcher- CommandLauncher
 
 
- 
 
-