T
- The concrete type of the class.public abstract class AbstractExecTask<T extends AbstractExecTask> extends org.gradle.api.internal.ConventionTask implements ExecSpec
AbstractExecTask
is the base class for all exec tasks.Task.Namer
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
コンストラクタと説明 |
---|
AbstractExecTask(Class<T> taskType) |
修飾子とタイプ | メソッドと説明 |
---|---|
T |
args(Iterable<?> args)
Adds arguments for the command to be executed.
|
T |
args(Object... args)
Adds arguments for the command to be executed.
|
T |
commandLine(Iterable<?> args)
Sets the full command line, including the executable to be executed plus its arguments.
|
T |
commandLine(Object... arguments)
Sets the full command line, including the executable to be executed plus its arguments.
|
T |
copyTo(ProcessForkOptions target)
Copies these options to the given target options.
|
T |
environment(Map<String,?> environmentVariables)
Adds some environment variables to the environment for this process.
|
T |
environment(String name,
Object value)
Adds an environment variable to the environment for this process.
|
protected void |
exec() |
T |
executable(Object executable)
Sets the name of the executable to use.
|
List<String> |
getArgs()
Returns the arguments for the command to be executed.
|
List<String> |
getCommandLine()
Returns the full command line, including the executable plus its arguments.
|
Map<String,Object> |
getEnvironment()
The environment variables to use for the process.
|
OutputStream |
getErrorOutput()
Returns the output stream to consume standard error from the process executing the command.
|
protected org.gradle.process.internal.ExecActionFactory |
getExecActionFactory() |
ExecResult |
getExecResult()
Returns the result 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.
|
OutputStream |
getStandardOutput()
Returns the output stream to consume standard output from the process executing the command.
|
File |
getWorkingDir()
Returns the working directory for the process.
|
boolean |
isIgnoreExitValue()
Tells whether a non-zero exit value is ignored, or an exception thrown.
|
T |
setArgs(Iterable<?> arguments)
Sets the arguments for the command to be executed.
|
void |
setCommandLine(Iterable<?> args)
Sets the full command line, including the executable to be executed plus its arguments.
|
void |
setCommandLine(Object... args)
Sets the full command line, including the executable to be executed plus its arguments.
|
void |
setEnvironment(Map<String,?> environmentVariables)
Sets the environment variable to use for the process.
|
T |
setErrorOutput(OutputStream outputStream)
Sets the output stream to consume standard error from the process executing the command.
|
void |
setExecutable(Object executable)
Sets the name of the executable to use.
|
T |
setIgnoreExitValue(boolean ignoreExitValue)
Sets whether a non-zero exit value is ignored, or an exception thrown.
|
T |
setStandardInput(InputStream inputStream)
Sets the standard input stream for the process executing the command.
|
T |
setStandardOutput(OutputStream outputStream)
Sets the output stream to consume standard output from the process executing the command.
|
void |
setWorkingDir(Object dir)
Sets the working directory for the process.
|
T |
workingDir(Object dir)
Sets the working directory for the process.
|
conventionMapping, conventionMapping, getConventionMapping
addValidator, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, executeWithoutThrowingTaskFailure, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, leftShift, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toString
@Inject protected org.gradle.process.internal.ExecActionFactory getExecActionFactory()
protected void exec()
public T commandLine(Object... arguments)
commandLine
インタフェース内 ExecSpec
arguments
- the command plus the args to be executedpublic T commandLine(Iterable<?> args)
commandLine
インタフェース内 ExecSpec
args
- the command plus the args to be executedpublic List<String> getArgs()
public List<String> getCommandLine()
getCommandLine
インタフェース内 BaseExecSpec
public void setCommandLine(Iterable<?> args)
setCommandLine
インタフェース内 ExecSpec
args
- the command plus the args to be executedpublic void setCommandLine(Object... args)
setCommandLine
インタフェース内 ExecSpec
args
- the command plus the args to be executedpublic String getExecutable()
getExecutable
インタフェース内 ProcessForkOptions
public void setExecutable(Object executable)
setExecutable
インタフェース内 ProcessForkOptions
executable
- The executable. Must not be null.public T executable(Object executable)
executable
インタフェース内 ProcessForkOptions
executable
- The executable. Must not be null.public File getWorkingDir()
getWorkingDir
インタフェース内 ProcessForkOptions
public void setWorkingDir(Object dir)
Project.file(Object)
.setWorkingDir
インタフェース内 ProcessForkOptions
dir
- The working directory. Must not be null.public T workingDir(Object dir)
Project.file(Object)
.workingDir
インタフェース内 ProcessForkOptions
dir
- The working directory. Must not be null.public Map<String,Object> getEnvironment()
getEnvironment
インタフェース内 ProcessForkOptions
public void setEnvironment(Map<String,?> environmentVariables)
setEnvironment
インタフェース内 ProcessForkOptions
environmentVariables
- The environment variables. Must not be null.public T environment(String name, Object value)
environment
インタフェース内 ProcessForkOptions
name
- The name of the variable.value
- The value for the variable. Must not be null.public T environment(Map<String,?> environmentVariables)
environment
インタフェース内 ProcessForkOptions
environmentVariables
- The environment variables. Must not be null.public T copyTo(ProcessForkOptions target)
copyTo
インタフェース内 ProcessForkOptions
target
- The target optionspublic T setStandardInput(InputStream inputStream)
setStandardInput
インタフェース内 BaseExecSpec
inputStream
- The standard input stream for the process. Must not be null.public InputStream getStandardInput()
getStandardInput
インタフェース内 BaseExecSpec
public T setStandardOutput(OutputStream outputStream)
setStandardOutput
インタフェース内 BaseExecSpec
outputStream
- The standard output stream for the process. Must not be null.public OutputStream getStandardOutput()
System.out
.getStandardOutput
インタフェース内 BaseExecSpec
public T setErrorOutput(OutputStream outputStream)
setErrorOutput
インタフェース内 BaseExecSpec
outputStream
- The standard output error stream for the process. Must not be null.public OutputStream getErrorOutput()
System.err
.getErrorOutput
インタフェース内 BaseExecSpec
public T setIgnoreExitValue(boolean ignoreExitValue)
setIgnoreExitValue
インタフェース内 BaseExecSpec
ignoreExitValue
- whether a non-zero exit value is ignored, or an exception thrownpublic boolean isIgnoreExitValue()
false
.isIgnoreExitValue
インタフェース内 BaseExecSpec
public ExecResult getExecResult()
null
if this task has not been executed yet.null
if this task has not been executed yet.