public class Exec extends ConventionTask
Executes a command line process. Example:
task stopTomcat(type:Exec) { workingDir '../tomcat/bin' //on windows: commandLine 'cmd', '/c', 'stop.bat' //on linux commandLine './stop.sh' //store the output instead of printing to the console: standardOutput = new ByteArrayOutputStream() //extension method stopTomcat.output() can be used to obtain the output: ext.output = { return standardOutput.toString() } }
Constructor and description |
---|
Exec
() |
Type | Name and description |
---|---|
Exec |
args(Object... args) {@inheritDoc} |
ExecSpec |
args(Iterable<?> args) {@inheritDoc} |
Exec |
commandLine(Object... arguments) {@inheritDoc} |
ExecSpec |
commandLine(Iterable<?> args) {@inheritDoc} |
Exec |
copyTo(ProcessForkOptions target) {@inheritDoc} |
Exec |
environment(String name, Object value) {@inheritDoc} |
Exec |
environment(Map<String, ?> environmentVariables) {@inheritDoc} |
Exec |
executable(Object executable) {@inheritDoc} |
List<String> |
getArgs() {@inheritDoc} |
List<String> |
getCommandLine() {@inheritDoc} |
Map<String, Object> |
getEnvironment() {@inheritDoc} |
OutputStream |
getErrorOutput() {@inheritDoc} |
protected ExecActionFactory |
getExecActionFactory() |
ExecResult |
getExecResult() Returns the result for the command run by this task. |
String |
getExecutable() {@inheritDoc} |
InputStream |
getStandardInput() {@inheritDoc} |
OutputStream |
getStandardOutput() {@inheritDoc} |
File |
getWorkingDir() {@inheritDoc} |
boolean |
isIgnoreExitValue() {@inheritDoc} |
Exec |
setArgs(Iterable<?> arguments) {@inheritDoc} |
void |
setCommandLine(Iterable<?> args) {@inheritDoc} |
void |
setCommandLine(Object... args) {@inheritDoc} |
void |
setEnvironment(Map<String, ?> environmentVariables) {@inheritDoc} |
Exec |
setErrorOutput(OutputStream outputStream) {@inheritDoc} |
void |
setExecutable(Object executable) {@inheritDoc} |
ExecSpec |
setIgnoreExitValue(boolean ignoreExitValue) {@inheritDoc} |
Exec |
setStandardInput(InputStream inputStream) {@inheritDoc} |
Exec |
setStandardOutput(OutputStream outputStream) {@inheritDoc} |
void |
setWorkingDir(Object dir) {@inheritDoc} |
Exec |
workingDir(Object dir) {@inheritDoc} |
{@inheritDoc}
{@inheritDoc}
Returns the result for the command run by this task. Returns null
if this task has not been executed yet.
null
if this task has not been executed yet.{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}