public class CommandLauncher
extends java.lang.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,
java.lang.String[] cmd,
java.lang.String[] env)
Launches the given command in a new process.
|
java.lang.Process |
exec(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 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, java.lang.String[] cmd, java.lang.String[] env) throws java.io.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.java.io.IOException
- if attempting to run a command in a specific directory.public java.lang.Process exec(Project project, java.lang.String[] cmd, java.lang.String[] env, java.io.File workingDir) throws java.io.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.java.io.IOException
- if trying to change directory.public static CommandLauncher getShellLauncher(Project project)
project
- Projectpublic static CommandLauncher getVMLauncher(Project project)
project
- Projectpublic static void setVMLauncher(Project project, CommandLauncher launcher)
project
- Projectlauncher
- CommandLauncherpublic static void setShellLauncher(Project project, CommandLauncher launcher)
project
- Projectlauncher
- CommandLauncher