| Modifier and Type | Field and Description |
|---|---|
| protected Commandline | |
| private File | |
| private Environment | |
| private File | |
| private String | |
| private boolean | |
| protected boolean | |
| private static final FileUtils | |
| private boolean | |
| private File | |
| private String | |
| protected boolean | |
| private String | |
| private String | |
| private File | |
| protected Redirector | |
| protected RedirectorElement | |
| private boolean | |
| private String | |
| private boolean | |
| private boolean | |
| private Long | |
| private boolean | vmLauncher
Controls whether the VM (1.3 and above) is used to execute the command |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addConfiguredRedirector(RedirectorElement
RedirectorElement.Add a |
| public void | addEnv(Environment.
new environment variable. varAdd an environment variable to the launched process. |
| protected void | |
| public Commandline. | |
| protected ExecuteStreamHandler | Returns: instance of ExecuteStreamHandler.Create the StreamHandler to use with our Execute instance. |
| protected ExecuteWatchdog | |
| public void | |
| public final String | |
| public final String | |
| private String | |
| private String | |
| public boolean | Returns: the resolveExecutable flagIndicates whether to attempt to resolve the executable to a file. |
| private boolean | |
| protected boolean | Returns: boolean.
Is this the OS the user wanted? |
| protected void | |
| protected void | maybeSetResultPropertyValue(int
value desired for the result property value. result)Helper method to set result property to the passed in value if appropriate. |
| protected Execute | Returns: an instance of the Execute class.Create an Execute instance with the correct working directory set. |
| protected String | Returns: the executable as a full path if it can be determined.the name of the executable. exec, boolean if true, the executable will be looked up in
the PATH environment and the absolute path is returned. mustSearchPath)The method attempts to figure out where the executable is so that we can feed the full path. |
| protected void | |
| protected final void | runExecute(Execute
instance of the execute class. exe)A Utility method for this classes and subclasses to run an Execute instance (an external command). |
| public void | setAppend(boolean
if true append is desired. append)Set whether output should be appended to or overwrite an existing file. |
| public void | |
| public void | |
| public void | setDiscardError(final boolean
if true error streams are discarded. discard)Whether error output should be discarded. |
| public void | setDiscardOutput(final boolean
if true output streams are discarded. discard)Whether output should be discarded. |
| public void | |
| public void | setErrorProperty(String
name of property. errorProperty)Sets the name of the property whose value should be set to the error of the process. |
| public void | setExecutable(String
the name of the executable program. value)Set the name of the executable program. |
| public void | setFailIfExecutionFails(boolean
stop the build if program cannot be started. flag)Set whether to stop the build if program cannot be started. |
| public void | setFailonerror(boolean
if true fail the command on non-zero return code. fail)Fail if the command exits with a non-zero return code. |
| public void | |
| public void | setInputString(String
the string which is used as the input source. inputString)Set the string to use as input. |
| public void | setLogError(boolean
set to true to log error output in the normal ant log. logError)Controls whether error output of exec is logged. |
| public void | setNewenvironment(boolean
if true, do not propagate old environment
when new environment variables are specified. newenv)Do not propagate old environment when new environment variables are specified. |
| public void | |
| public void | |
| public void | |
| public void | setOutputproperty(String
name of property. outputProp)Sets the property name whose value should be set to the output of the process. |
| public void | setResolveExecutable(boolean
if true, attempt to resolve the
path of the executable. resolveExecutable)Set whether to attempt to resolve the executable to a file. |
| public void | setResultProperty(String
name of property. resultProperty)Sets the name of a property in which the return code of the command should be stored. |
| public void | setSearchPath(boolean
if true, search PATHs. searchPath)Set whether to search nested, then system PATH environment variables for the executable. |
| public void | setSpawn(boolean
if true you do not want Ant to wait for the end of the process. spawn)Set whether or not you want the process to be spawned. |
| public void | setTimeout(Long
timeout in milliseconds. value)Set the timeout in milliseconds after which the process will be killed. |
| public void | setTimeout(Integer
timeout in milliseconds. value)Set the timeout in milliseconds after which the process will be killed. |
| protected void | |
| public void | setVMLauncher(boolean
true if we want to launch new process with VM,
false if we want to use the OS's shell. vmLauncher)Set whether to launch new process with VM, otherwise use the OS's shell. |
| cmdl | back to summary |
|---|---|
| protected Commandline cmdl | |
| dir | back to summary |
|---|---|
| private File dir | |
| env | back to summary |
|---|---|
| private Environment env | |
| error | back to summary |
|---|---|
| private File error | |
| executable | back to summary |
|---|---|
| private String executable | |
| failIfExecFails | back to summary |
|---|---|
| private boolean failIfExecFails | |
| failOnError | back to summary |
|---|---|
| protected boolean failOnError | |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS | |
| incompatibleWithSpawn | back to summary |
|---|---|
| private boolean incompatibleWithSpawn | |
| input | back to summary |
|---|---|
| private File input | |
| inputString | back to summary |
|---|---|
| private String inputString | |
| newEnvironment | back to summary |
|---|---|
| protected boolean newEnvironment | |
| os | back to summary |
|---|---|
| private String os | |
| osFamily | back to summary |
|---|---|
| private String osFamily | |
| output | back to summary |
|---|---|
| private File output | |
| redirector | back to summary |
|---|---|
| protected Redirector redirector | |
| redirectorElement | back to summary |
|---|---|
| protected RedirectorElement redirectorElement | |
| resolveExecutable | back to summary |
|---|---|
| private boolean resolveExecutable | |
| resultProperty | back to summary |
|---|---|
| private String resultProperty | |
| searchPath | back to summary |
|---|---|
| private boolean searchPath | |
| spawn | back to summary |
|---|---|
| private boolean spawn | |
| timeout | back to summary |
|---|---|
| private Long timeout | |
| vmLauncher | back to summary |
|---|---|
| private boolean vmLauncher Controls whether the VM (1.3 and above) is used to execute the command | |
| ExecTask | back to summary |
|---|---|
| public ExecTask() Create an instance. Needs to be configured by binding to a project. | |
| ExecTask | back to summary |
|---|---|
| public ExecTask(Task owner) create an instance that is helping another task. Project, OwningTarget, TaskName and description are all pulled out
| |
| addConfiguredRedirector | back to summary |
|---|---|
| public void addConfiguredRedirector(RedirectorElement redirectorElement) Add a
| |
| addEnv | back to summary |
|---|---|
| public void addEnv(Environment. Add an environment variable to the launched process.
| |
| checkConfiguration | back to summary |
|---|---|
| protected void checkConfiguration() throws BuildException Has the user set all necessary attributes?
| |
| createArg | back to summary |
|---|---|
| public Commandline. Adds a command-line argument.
| |
| createHandler | back to summary |
|---|---|
| protected ExecuteStreamHandler createHandler() throws BuildException Create the StreamHandler to use with our Execute instance.
| |
| createWatchdog | back to summary |
|---|---|
| protected ExecuteWatchdog createWatchdog() throws BuildException Create the Watchdog to kill a runaway process.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Do the work.
| |
| getOs | back to summary |
|---|---|
| public final String getOs() List of operating systems on which the command may be executed.
| |
| getOsFamily | back to summary |
|---|---|
| public final String getOsFamily() Restrict this execution to a single OS Family
| |
| getPath | back to summary |
|---|---|
| private String getPath(String line) | |
| getPath | back to summary |
|---|---|
| private String getPath(Map<String, String> map) | |
| getResolveExecutable | back to summary |
|---|---|
| public boolean getResolveExecutable() Indicates whether to attempt to resolve the executable to a file.
| |
| isPath | back to summary |
|---|---|
| private boolean isPath(String line) | |
| isValidOs | back to summary |
|---|---|
| protected boolean isValidOs() Is this the OS the user wanted?
| |
| logFlush | back to summary |
|---|---|
| protected void logFlush() Flush the output stream - if there is one. | |
| maybeSetResultPropertyValue | back to summary |
|---|---|
| protected void maybeSetResultPropertyValue(int result) Helper method to set result property to the passed in value if appropriate.
| |
| prepareExec | back to summary |
|---|---|
| protected Execute prepareExec() throws BuildException Create an Execute instance with the correct working directory set.
| |
| resolveExecutable | back to summary |
|---|---|
| protected String resolveExecutable(String exec, boolean mustSearchPath) The method attempts to figure out where the executable is so that we can feed the full path. We first try basedir, then the exec dir, and then fallback to the straight executable name (i.e. on the path). | |
| runExec | back to summary |
|---|---|
| protected void runExec(Execute exe) throws BuildException Run the command using the given Execute instance. This may be overridden by subclasses.
| |
| runExecute | back to summary |
|---|---|
| protected final void runExecute(Execute exe) throws IOException A Utility method for this classes and subclasses to run an Execute instance (an external command).
| |
| setAppend | back to summary |
|---|---|
| public void setAppend(boolean append) Set whether output should be appended to or overwrite an existing file. Defaults to false.
| |
| setCommand | back to summary |
|---|---|
| public void setCommand(Commandline cmdl) Sets a command line.
| |
| setDir | back to summary |
|---|---|
| public void setDir(File d) Set the working directory of the process.
| |
| setDiscardError | back to summary |
|---|---|
| public void setDiscardError(final boolean discard) Whether error output should be discarded. Defaults to false.
| |
| setDiscardOutput | back to summary |
|---|---|
| public void setDiscardOutput(final boolean discard) Whether output should be discarded. Defaults to false.
| |
| setError | back to summary |
|---|---|
| public void setError(File error) Set the File to which the error stream of the process should be redirected.
| |
| setErrorProperty | back to summary |
|---|---|
| public void setErrorProperty(String errorProperty) Sets the name of the property whose value should be set to the error of the process.
| |
| setExecutable | back to summary |
|---|---|
| public void setExecutable(String value) Set the name of the executable program.
| |
| setFailIfExecutionFails | back to summary |
|---|---|
| public void setFailIfExecutionFails(boolean flag) Set whether to stop the build if program cannot be started. Defaults to true.
| |
| setFailonerror | back to summary |
|---|---|
| public void setFailonerror(boolean fail) Fail if the command exits with a non-zero return code.
| |
| setInput | back to summary |
|---|---|
| public void setInput(File input) Set the input file to use for the task.
| |
| setInputString | back to summary |
|---|---|
| public void setInputString(String inputString) Set the string to use as input.
| |
| setLogError | back to summary |
|---|---|
| public void setLogError(boolean logError) Controls whether error output of exec is logged. This is only useful when output is being redirected and error output is desired in the Ant log.
| |
| setNewenvironment | back to summary |
|---|---|
| public void setNewenvironment(boolean newenv) Do not propagate old environment when new environment variables are specified.
| |
| setOs | back to summary |
|---|---|
| public void setOs(String os) List of operating systems on which the command may be executed.
| |
| setOsFamily | back to summary |
|---|---|
| public void setOsFamily(String osFamily) Restrict this execution to a single OS Family
| |
| setOutput | back to summary |
|---|---|
| public void setOutput(File out) File the output of the process is redirected to. If error is not redirected, it too will appear in the output.
| |
| setOutputproperty | back to summary |
|---|---|
| public void setOutputproperty(String outputProp) Sets the property name whose value should be set to the output of the process.
| |
| setResolveExecutable | back to summary |
|---|---|
| public void setResolveExecutable(boolean resolveExecutable) Set whether to attempt to resolve the executable to a file.
| |
| setResultProperty | back to summary |
|---|---|
| public void setResultProperty(String resultProperty) Sets the name of a property in which the return code of the command should be stored. Only of interest if failonerror=false.
| |
| setSearchPath | back to summary |
|---|---|
| public void setSearchPath(boolean searchPath) Set whether to search nested, then system PATH environment variables for the executable.
| |
| setSpawn | back to summary |
|---|---|
| public void setSpawn(boolean spawn) Set whether or not you want the process to be spawned. Default is false.
| |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(Long value) Set the timeout in milliseconds after which the process will be killed.
| |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(Integer value) Set the timeout in milliseconds after which the process will be killed.
| |
| setupRedirector | back to summary |
|---|---|
| protected void setupRedirector() Set up properties on the redirector that we needed to store locally. | |
| setVMLauncher | back to summary |
|---|---|
| public void setVMLauncher(boolean vmLauncher) Set whether to launch new process with VM, otherwise use the OS's shell. Default value is true.
| |