A base class to aid plugin developers create their own ExecSpec implementations.
Fields inherited from class | Fields |
---|---|
class AbstractExecSpec |
env, project, workingDir |
Constructor and description |
---|
protected AbstractToolExecSpec
(Project project, ExternalExecutable executableResolver) Construct class and attach it to specific project. |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.util.List<String> |
buildCommandLine() Builds up the command line. |
|
AbstractToolExecSpec |
configure(Action<? extends AbstractToolExecSpec> action) Configure this spec from an Action |
|
AbstractToolExecSpec |
configure(groovy.lang.Closure cfg) Configure this spec from a closure. |
|
ProcessForkOptions |
copyTo(ProcessForkOptions processForkOptions) Copies options from this Spec to the given target. |
|
void |
copyToExecSpec(ExecSpec execSpec) Copies settings from this execution specification to a standard ExecSpec |
|
void |
exeArgs(Iterable<?> args) Add more tool-specific arguments. |
|
void |
exeArgs(Object... args) Add more tool-specific arguments. |
|
ProcessForkOptions |
executable(Object exe) Set the executable to use. |
|
ProcessForkOptions |
executable(ResolvableExecutable resolver) Set the executable to use. |
|
void |
executable(java.util.Map<String, Object> exe) Use a key-value approach to setting the executable. |
|
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.List<String> |
getExeArgs() Any arguments specific to the tool in use |
|
String |
getExecutable() The executable used in this specification as a String. |
|
protected ExternalExecutable |
getExecutableResolver() Access to the object that can resolve executable location from property maps. |
|
protected java.util.List<String> |
getInstructionsArgs() List of arguments specific to the tool instruction. |
|
ResolvableExecutable |
getResolvableExecutable() Lazy-evaluated version of the executable |
|
protected String |
getToolInstruction() A specific instruction passed to a tool. |
|
protected void |
instructionArgs(Iterable<?> args) Add more instruction-specific arguments. |
|
protected void |
instructionArgs(Object... args) Add more instruction-specific arguments. |
|
void |
setExeArgs(Iterable<?> args) Replace the tool-specific arguments with a new set. |
|
void |
setExecutable(Object exe) Set the executable to use. |
|
void |
setExecutable(ResolvableExecutable resolver) Set the executable to use. |
|
void |
setExecutable(String exe) Set the executable to use. |
|
void |
setExecutable(java.util.Map<String, Object> exe) Use a key-value approach to setting the executable. |
|
protected void |
setInstructionArgs(Iterable<?> args) Replace the instruction-specific arguments with a new set. |
Methods inherited from class | Name |
---|---|
class AbstractExecSpec |
environment, environment, errorOutput, getEnvironment, getErrorOutput, getStandardInput, getStandardOutput, getWorkingDir, ignoreExitValue, isIgnoreExitValue, setEnvironment, setErrorOutput, setIgnoreExitValue, setStandardInput, setStandardOutput, setWorkingDir, setWorkingDir, standardInput, standardOutput, workingDir |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Construct class and attach it to specific project.
project
- Project this exec spec is attached.executableResolver
- A way to resolve executables.Builds up the command line.
The default format in use is the following:
executable exeArgs... toolInstruction instructionsArgs...
toolInstruction
is typically a command or a script and
instructionArgs
the arguments for that script of tool. exeArgs
are any
command-line arguments meant for the executable which do not form part of the script/command
customisation.
GradleException
if executable is not set.Configure this spec from an Action
this
.action
- Configurating action.Configure this spec from a closure.
cfg
- Closure to use.Copies options from this Spec to the given target. If the target is not an instance of AbstractToolExecSpec and the executable is of type ResolvableExecutable then it will be processed before copying.
processForkOptions
- Copy to this target. Copies settings from this execution specification to a standard ExecSpec
This method is intended to be called as late as possible by a project extension or a task which would want to delegate to
{@ project.exec} project extension. It will cause arguments to be evaluated.
The only items not immediately evaluated are workingDir
and executable
.
execSpec
- Exec spec to configure.Add more tool-specific arguments.
args
- Additional list of argumentsAdd more tool-specific arguments.
args
- Additional list of arguments Set the executable to use.
If you need to search the system path, to find the executable use the search : 'exeName'
form instead.
exe
- Anything that can be resolved via org.ysb33r.gradle.olifant.StringUtils.stringize(Object) or an implementation of
ResolvableExecutableSet the executable to use.
exe
- An implementation of ResolvableExecutable Use a key-value approach to setting the executable.
In the default implementation only path
and search
are supported as a declarative keys. Implementations should use
registerExecutableKeyAction to add more keys.
exe
- Key-value setting executable (with optional extra keys)Returns the full script line, including the executable, it's specific arguments, tool specific instruction and the arguments spefic to the instruction.
Any arguments specific to the tool in use
The executable used in this specification as a String.
Access to the object that can resolve executable location from property maps.
List of arguments specific to the tool instruction.
Lazy-evaluated version of the executable
null
if not configured.A specific instruction passed to a tool. * Instruction can be empty or null. In the default implementation getToolInstructionArgs() will be ignored.
Add more instruction-specific arguments.
args
- Additional list of argumentsAdd more instruction-specific arguments.
args
- Additional list of argumentsReplace the tool-specific arguments with a new set.
args
- New list of tool-specific arguments Set the executable to use.
If you need to search the system path, to find the executable use the search : 'exeName'
form instead.
exe
- Anything that can be resolved via org.ysb33r.gradle.olifant.StringUtils.stringize(Object) or an implementation of
ResolvableExecutableSet the executable to use.
exe
- An implementation of ResolvableExecutableSet the executable to use.
This variant of the method has been introduced to cope with the API change in Gradle 4.0.
exe
- Executable as String representation Use a key-value approach to setting the executable.
In the default implementation only path
and search
are supported as a declarative keys. Implementations should use
registerExecutableKeyAction to add more keys.
exe
- Key-value setting executable (with optional extra keys)Replace the instruction-specific arguments with a new set.
args
- New list of instruction-specific arguments