|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gradle.api.internal.AbstractTask org.gradle.api.DefaultTask org.gradle.api.internal.ConventionTask org.gradle.api.tasks.Exec
public class Exec
A task for executing a command line process.
Field Summary |
---|
Fields inherited from interface org.gradle.api.Task |
---|
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_NAME, TASK_OVERWRITE, TASK_TYPE |
Constructor Summary | |
---|---|
Exec()
|
Method Summary | |
---|---|
ExecSpec |
args(Iterable<?> args)
Adds args for the command to be executed. |
Exec |
args(Object... args)
Adds args for the command to be executed. |
ExecSpec |
commandLine(Iterable<?> args)
Sets the command plus the args to be executed. |
Exec |
commandLine(Object... arguments)
Sets the command plus the args to be executed. |
Exec |
copyTo(ProcessForkOptions target)
Copies these options to the given target options. |
Exec |
environment(Map<String,?> environmentVariables)
Adds some environment variables to the environment for this process. |
Exec |
environment(String name,
Object value)
Adds an environment variable to the environment for this process. |
Exec |
executable(Object executable)
Sets the name of the executable to use. |
List<String> |
getArgs()
Returns the args for the command to be executed |
List<String> |
getCommandLine()
Returns the command plus its arguments. |
Map<String,Object> |
getEnvironment()
The environment variables to use for the process. |
ExecResult |
getExecResult()
Returns the ExecResult object for the command run by this task. |
String |
getExecutable()
Returns the name of the executable to use. |
InputStream |
getStandardInput()
Returns the standard input stream for the process executing the command. |
File |
getWorkingDir()
Returns the working directory for the process. |
boolean |
isIgnoreExitValue()
Returns whether an exit value different from zero should be ignored. |
Exec |
setArgs(Iterable<?> arguments)
Sets the args for the command to be executed. |
void |
setEnvironment(Map<String,?> environmentVariables)
Sets the environment variable to use for the process. |
Exec |
setErrorOutput(OutputStream outputStream)
Sets the error output stream for the process executing the command. |
void |
setExecutable(Object executable)
Sets the name of the executable to use. |
ExecSpec |
setIgnoreExitValue(boolean ignoreExitValue)
Sets whether an exit value different from zero should be ignored. |
Exec |
setStandardInput(InputStream inputStream)
Sets the standard input stream for the process executing the command. |
Exec |
setStandardOutput(OutputStream outputStream)
Sets the standard output stream for the process executing the command. |
void |
setWorkingDir(Object dir)
Sets the working directory for the process. |
Exec |
workingDir(Object dir)
Sets the working directory for the process. |
Methods inherited from class org.gradle.api.internal.ConventionTask |
---|
conventionMapping, getConventionMapping, setConventionMapping |
Methods inherited from class org.gradle.api.internal.AbstractTask |
---|
captureStandardOutput, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doFirst, doLast, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuter, getGroup, getInputs, getLogger, getLogging, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getStandardOutputCapture, getState, getTaskDependencies, getTemporaryDir, hashCode, hasProperty, injectIntoNewInstance, isEnabled, leftShift, onlyIf, onlyIf, property, setActions, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setGroup, setName, setOnlyIf, setOnlyIf, setProject, setProperty, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.gradle.api.Task |
---|
captureStandardOutput, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doFirst, doLast, doLast, getActions, getAnt, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getGroup, getInputs, getLogger, getLogging, getName, getOutputs, getPath, getProject, getState, getTaskDependencies, getTemporaryDir, hasProperty, leftShift, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setEnabled, setGroup, setOnlyIf, setOnlyIf, setProperty |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public Exec()
Method Detail |
---|
public Exec commandLine(Object... arguments)
commandLine
in interface ExecSpec
arguments
- the command plus the args to be executed
public ExecSpec commandLine(Iterable<?> args)
commandLine
in interface ExecSpec
args
- the command plus the args to be executed
public Exec args(Object... args)
args
in interface ExecSpec
args
- args for the command
public ExecSpec args(Iterable<?> args)
args
in interface ExecSpec
args
- args for the command
public Exec setArgs(Iterable<?> arguments)
setArgs
in interface ExecSpec
arguments
- args for the command
public List<String> getArgs()
getArgs
in interface ExecSpec
public List<String> getCommandLine()
getCommandLine
in interface BaseExecSpec
public String getExecutable()
getExecutable
in interface ProcessForkOptions
public void setExecutable(Object executable)
setExecutable
in interface ProcessForkOptions
executable
- The executable. Must not be null.public Exec executable(Object executable)
executable
in interface ProcessForkOptions
executable
- The executable. Must not be null.
public File getWorkingDir()
getWorkingDir
in interface ProcessForkOptions
public void setWorkingDir(Object dir)
Project.file(Object)
.
setWorkingDir
in interface ProcessForkOptions
dir
- The working directory. Must not be null.public Exec workingDir(Object dir)
Project.file(Object)
.
workingDir
in interface ProcessForkOptions
dir
- The working directory. Must not be null.
public Map<String,Object> getEnvironment()
getEnvironment
in interface ProcessForkOptions
public void setEnvironment(Map<String,?> environmentVariables)
setEnvironment
in interface ProcessForkOptions
environmentVariables
- The environment variables. Must not be null.public Exec environment(String name, Object value)
environment
in interface ProcessForkOptions
name
- The name of the variable.value
- The value for the variable. Must not be null.
public Exec environment(Map<String,?> environmentVariables)
environment
in interface ProcessForkOptions
environmentVariables
- The environment variables. Must not be null.
public Exec copyTo(ProcessForkOptions target)
copyTo
in interface ProcessForkOptions
target
- The target options
public Exec setStandardInput(InputStream inputStream)
setStandardInput
in interface BaseExecSpec
inputStream
- The standard input stream for the command process.
public InputStream getStandardInput()
getStandardInput
in interface BaseExecSpec
public Exec setStandardOutput(OutputStream outputStream)
setStandardOutput
in interface BaseExecSpec
outputStream
- The standard output stream for the command process.
public Exec setErrorOutput(OutputStream outputStream)
setErrorOutput
in interface BaseExecSpec
outputStream
- The standard output error stream for the command process.
public ExecSpec setIgnoreExitValue(boolean ignoreExitValue)
setIgnoreExitValue
in interface BaseExecSpec
ignoreExitValue
- whether to ignore the exit value or not
public boolean isIgnoreExitValue()
false
.
isIgnoreExitValue
in interface BaseExecSpec
public ExecResult getExecResult()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |