|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.ExecTask
Executes a given command if the os platform is appropriate.
Field Summary | |
protected Commandline |
cmdl
|
protected boolean |
failOnError
|
protected boolean |
newEnvironment
|
Fields inherited from class org.apache.tools.ant.Task |
description, location, project, target, taskName, taskType, wrapper |
Constructor Summary | |
ExecTask()
|
Method Summary | |
void |
addEnv(Environment.Variable var)
Add a nested env element - an environment variable. |
protected void |
checkConfiguration()
Has the user set all necessary attributes? |
Commandline.Argument |
createArg()
Add a nested arg element - 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 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. |
void |
setCommand(Commandline cmdl)
The full commandline to execute, executable + arguments. |
void |
setDir(java.io.File d)
The working directory of the process |
void |
setExecutable(java.lang.String value)
The command to execute. |
void |
setFailonerror(boolean fail)
Throw a BuildException if process returns non 0. |
void |
setNewenvironment(boolean newenv)
Use a completely new environment |
void |
setOs(java.lang.String os)
Only execute the process if os.name is included in this string. |
void |
setOutput(java.io.File out)
File the output of the process is redirected to. |
void |
setTimeout(java.lang.Integer value)
Timeout in milliseconds after which the process will be killed. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
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.Integer value)
public void setExecutable(java.lang.String value)
public void setDir(java.io.File d)
public void setOs(java.lang.String os)
os.name
is included in this string.public void setCommand(Commandline cmdl)
public void setOutput(java.io.File out)
public void setFailonerror(boolean fail)
public void setNewenvironment(boolean newenv)
public void addEnv(Environment.Variable var)
public Commandline.Argument createArg()
public void execute() throws BuildException
execute
in class Task
org.apache.tools.ant.Task
BuildException
- if someting goes wrong with the buildprotected void checkConfiguration() throws BuildException
protected boolean isValidOs()
protected Execute prepareExec() throws BuildException
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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |