net.sf.antcontrib.platform
Class ShellScriptTask
ExecTask
net.sf.antcontrib.platform.ShellScriptTask
public class ShellScriptTask
extends ExecTask
A generic front-end for passing "shell lines" to any application which can
accept a filename containing script input (bash, perl, csh, tcsh, etc.).
see antcontrib doc for useage
void | addText(String s) - Adds s to the lines of script code.
|
void | execute() - execute the task
|
void | setCommand(Commandline notUsed) - Disallow the command attribute of parent class ExecTask.
|
void | setExecutable(String shell) - Sets the shell used to run the script.
|
void | setInputString(String s) - Sets script code to s.
|
void | setShell(String shell) - Sets the shell used to run the script.
|
void | setTmpSuffix(String tmpSuffix) - Sets the suffix for the tmp file used to
contain the script.
|
protected void | writeScript() - Writes the script lines to a temp file.
|
addText
public void addText(String s)
Adds s to the lines of script code.
execute
public void execute()
throws BuildException
execute the task
setCommand
public void setCommand(Commandline notUsed)
Disallow the command attribute of parent class ExecTask.
ant.attribute ignore="true"
setExecutable
public void setExecutable(String shell)
Sets the shell used to run the script.
shell
- the shell to use (bash is default)
setInputString
public void setInputString(String s)
Sets script code to s.
setShell
public void setShell(String shell)
Sets the shell used to run the script.
shell
- the shell to use (bash is default)
setTmpSuffix
public void setTmpSuffix(String tmpSuffix)
Sets the suffix for the tmp file used to
contain the script.
This is useful for cmd.exe as one can
use cmd /c call x.bat
tmpSuffix
- the suffix to use
writeScript
protected void writeScript()
throws BuildException
Writes the script lines to a temp file.