|
ExecTask (Apache Ant API)
org.apache.tools.ant.taskdefs
|
Field Summary | |
protected Commandline |
cmdl
|
protected boolean |
failOnError
|
protected boolean |
newEnvironment
|
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
ExecTask()
|
Method Summary | |
void |
addEnv(Environment.Variable var)
Add an environment variable to the launched process. |
protected void |
checkConfiguration()
Has the user set all necessary attributes? |
Commandline.Argument |
createArg()
Adds a command-line argument. |
protected ExecuteStreamHandler |
createHandler()
Create the StreamHandler to use with our Execute instance. |
protected ExecuteWatchdog |
createWatchdog()
Create the Watchdog to kill a runaway process. |
void |
execute()
Do the work. |
protected boolean |
isValidOs()
Is this the OS the user wanted? |
protected void |
logFlush()
Flush the output stream - if there is one. |
protected void |
maybeSetResultPropertyValue(int result)
helper method to set result property to the passed in value if appropriate |
protected Execute |
prepareExec()
Create an Execute instance with the correct working directory set. |
protected void |
runExec(Execute exe)
Run the command using the given Execute instance. |
protected void |
runExecute(Execute exe)
A Utility method for this classes and subclasses to run an Execute instance (an external command). |
void |
setAppend(boolean append)
Whether output should be appended to or overwrite an existing file. |
void |
setCommand(Commandline cmdl)
|
void |
setDir(java.io.File d)
The working directory of the process. |
void |
setExecutable(java.lang.String value)
The command to execute. |
void |
setFailIfExecutionFails(boolean flag)
Stop the build if program cannot be started. |
void |
setFailonerror(boolean fail)
Fail if the command exits with a non-zero return code. |
void |
setNewenvironment(boolean newenv)
Do not propagate old environment when new environment variables are specified. |
void |
setOs(java.lang.String os)
List of operating systems on which the command may be executed. |
void |
setOutput(java.io.File out)
File the output of the process is redirected to. |
void |
setOutputproperty(java.lang.String outputprop)
Property name whose value should be set to the output of the process. |
void |
setResultProperty(java.lang.String resultProperty)
The name of a property in which the return code of the command should be stored. |
void |
setTimeout(java.lang.Integer value)
Timeout in milliseconds after which the process will be killed. |
void |
setTimeout(java.lang.Long value)
Timeout in milliseconds after which the process will be killed. |
void |
setVMLauncher(boolean vmLauncher)
If true, launch new process with VM, otherwise use the OS's shell. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean failOnError
protected boolean newEnvironment
protected Commandline cmdl
Constructor Detail |
public ExecTask()
Method Detail |
public void setTimeout(java.lang.Long value)
public void setTimeout(java.lang.Integer value)
public void setExecutable(java.lang.String value)
public void setDir(java.io.File d)
public void setOs(java.lang.String os)
public void setCommand(Commandline cmdl)
public void setOutput(java.io.File out)
public void setOutputproperty(java.lang.String outputprop)
public void setFailonerror(boolean fail)
public void setNewenvironment(boolean newenv)
public void addEnv(Environment.Variable var)
public Commandline.Argument createArg()
public void setResultProperty(java.lang.String resultProperty)
protected void maybeSetResultPropertyValue(int result)
public void setFailIfExecutionFails(boolean flag)
public void setAppend(boolean append)
public void execute() throws BuildException
BuildException
- if something goes wrong with the buildprotected void checkConfiguration() throws BuildException
protected boolean isValidOs()
public void setVMLauncher(boolean vmLauncher)
protected Execute prepareExec() throws BuildException
protected final void runExecute(Execute exe) throws java.io.IOException
java.io.IOException
protected void runExec(Execute exe) throws BuildException
protected ExecuteStreamHandler createHandler() throws BuildException
protected ExecuteWatchdog createWatchdog() throws BuildException
protected void logFlush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |