A base class to use for developing execution tasks for wrapping execution tools
Fields inherited from class | Fields |
---|---|
class DefaultTask |
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION |
class AbstractTask |
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION |
Constructor and description |
---|
protected AbstractExecTask
() Creates class and sets default environment to be that of Gradle, |
Type Params | Return Type | Name and description |
---|---|---|
|
protected T |
createExecSpec(Project project) Factory method for creating an execution specification |
|
B |
environment(java.util.Map<String, ?> map) Add additional environment variables for use with the process. |
|
B |
environment(String envVar, Object value) Add additional environment variable for use with the process. |
|
B |
errorOutput(OutputStream outputStream) Set the stream where error output should be sent to for this process when executing. |
|
void |
exeArgs(Iterable<?> args) Add more tool-specific arguments. |
|
void |
exeArgs(Object... args) Add more tool-specific arguments. |
|
void |
exec() Runs this process against an internal execution specification. |
|
java.util.List<String> |
getCommandLine() Returns the full script line, including the executable, it's specific arguments, tool specific instruction and the arguments spefic to the instruction. |
|
java.util.Map<String, Object> |
getEnvironment() Returns the environment to be used for the process. |
|
OutputStream |
getErrorOutput() Where error output is sent to during execution. |
|
java.util.List<String> |
getExeArgs() Any arguments specific to the tool in use |
|
ExecResult |
getExecResult() Returns the result for the execution, that was run by this task. |
|
protected T |
getExecSpec() Provides access to the execution specification that is associated with this task |
|
String |
getExecutable() The executable used in this specification as a String. |
|
InputStream |
getStandardInput() Where input is read from during execution. |
|
OutputStream |
getStandardOutput() Where standard output is sent to during execution. |
|
File |
getWorkingDir() Obtain the working directory for this process. |
|
B |
ignoreExitValue(boolean flag) Determine whether the exit value should be ignored. |
|
boolean |
isIgnoreExitValue() State of exit value monitoring. |
|
void |
setEnvironment(java.util.Map<String, ?> map) Set the environment variables to use for the process. |
|
B |
setErrorOutput(OutputStream outputStream) Set the stream where error output should be sent to for this process when executing. |
|
void |
setExeArgs(Iterable<?> args) Replace the tool-specific arguments with a new set. |
|
B |
setIgnoreExitValue(boolean flag) Determine whether the exit value should be ignored. |
|
B |
setStandardInput(InputStream inputStream) Set the stream where standard input should be read from for this process when executing. |
|
B |
setStandardOutput(OutputStream outputStream) Set the stream where standard output should be sent to for this process when executing. |
|
protected void |
setToolExecutable(Object exe) Sets the executable to use for this task |
|
void |
setWorkingDir(Object workDir) Set the working directory for the execution. |
|
B |
standardInput(InputStream inputStream) Set the stream where standard input should be read from for this process when executing. |
|
B |
standardOutput(OutputStream outputStream) Set the stream where standard output should be sent to for this process when executing. |
|
B |
workingDir(Object workDir) Set the working directory for the execution. |
Creates class and sets default environment to be that of Gradle,
Factory method for creating an execution specification
project
- Project that the execution speciofication should be associated to.Add additional environment variables for use with the process.
this
.map
- Environmental variables as key-value pairs.Add additional environment variable for use with the process.
this
.envVar
- Name of environmental variable.value
- Value of environmental variable.Set the stream where error output should be sent to for this process when executing.
this
.outputStream
- Output stream to use.Add more tool-specific arguments.
args
- Additional list of argumentsAdd more tool-specific arguments.
args
- Additional list of argumentsRuns this process against an internal execution specification. If a failure occurs and isIgnoreExitValue is not set, an exception will be raised.
Returns the full script line, including the executable, it's specific arguments, tool specific instruction and the arguments spefic to the instruction.
Returns the environment to be used for the process. Defaults to the environment of this process.
Where error output is sent to during execution.
Any arguments specific to the tool in use
Returns the result for the execution, that was run by this task.
Provides access to the execution specification that is associated with this task
The executable used in this specification as a String.
Where input is read from during execution.
Where standard output is sent to during execution.
Obtain the working directory for this process. This call will evaluate the lazily-set working directory for setWorkingDir0
java.io.File
object.Determine whether the exit value should be ignored.
this
.flag
- Whether exit value should be ignored.State of exit value monitoring.
Set the environment variables to use for the process.
map
- Environmental variables as key-value pairs.Set the stream where error output should be sent to for this process when executing.
this
.outputStream
- Output stream to use.Replace the tool-specific arguments with a new set.
args
- New list of tool-specific argumentsDetermine whether the exit value should be ignored.
this
.flag
- Whether exit value should be ignored.Set the stream where standard input should be read from for this process when executing.
this
.inputStream
- Inout stream to use.Set the stream where standard output should be sent to for this process when executing.
this
.outputStream
- Output stream to use.Sets the executable to use for this task
exe
- Anything resolvable via org.ysb33r.gradle.olifant.StringUtils.stringizeSet the working directory for the execution.
workDir
- Any object that is convertiable using Gradle's project.file
.Set the stream where standard input should be read from for this process when executing.
this
.inputStream
- Inout stream to use.Set the stream where standard output should be sent to for this process when executing.
this
.outputStream
- Output stream to use.Set the working directory for the execution.
workDir
- Any object that is convertible using Gradle's project.file
.