public class CommandLauncher extends Object
Modifier and Type | Field and Description |
---|---|
protected static FileUtils |
FILE_UTILS |
Constructor and Description |
---|
CommandLauncher() |
Modifier and Type | Method and Description |
---|---|
java.lang.Process |
exec(Project project,
String[] cmd,
String[] env)
Launches the given command in a new process.
|
java.lang.Process |
exec(Project project,
String[] cmd,
String[] env,
File workingDir)
Launches the given command in a new process, in the given
working directory.
|
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.
|
protected static final FileUtils FILE_UTILS
public java.lang.Process exec(Project project, String[] cmd, String[] env) throws IOException
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.IOException
- if attempting to run a command in a specific directory.public java.lang.Process exec(Project project, String[] cmd, String[] env, File workingDir) throws IOException
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.IOException
- if trying to change directory.public static CommandLauncher getShellLauncher(Project project)
public static CommandLauncher getVMLauncher(Project project)
public static void setShellLauncher(Project project, CommandLauncher launcher)
public static void setVMLauncher(Project project, CommandLauncher launcher)