@Deprecated @groovy.transform.CompileStatic abstract class AbstractToolExecSpec extends AbstractExecSpec
A base class to aid plugin developers create their own ExecSpec implementations.
Fields inherited from class | Fields |
---|---|
class AbstractExecSpec |
env, project, workingDir |
Type | Name and description |
---|---|
Iterable<?> |
exeArgs |
String |
executable |
String |
executable |
String |
executable |
String |
executable |
String |
executable |
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 exe to use. |
|
ProcessForkOptions |
executable(ResolvableExecutable resolver) Set the exe to use. |
|
ProcessForkOptions |
executable(ResolvableExecutable resolver) |
|
void |
executable(java.util.Map<String, Object> exe) Use a key-value approach to setting the exe. |
|
java.util.List<String> |
getCommandLine() Returns the full script line, including the exe, it's specific arguments, tool specific instruction and the arguments specific to the instruction. |
|
java.util.List<String> |
getExeArgs() Any arguments specific to the tool in use |
|
String |
getExecutable() The exe used in this specification as a String. |
|
protected ExternalExecutable |
getExecutableResolver() Access to the object that can resolve exe 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 exe |
|
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 exe to use. |
|
void |
setExecutable(ResolvableExecutable resolver) Set the exe to use. |
|
void |
setExecutable(ResolvableExecutable resolver) Set the exe to use. |
|
void |
setExecutable(String exe) Set the exe to use. |
|
void |
setExecutable(java.util.Map<String, Object> exe) Use a key-value approach to setting the exe. |
|
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:
exe 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 exe which do not form part of the script/command
customisation.
GradleException
if exe is not set.Configure this spec from an Action
action
- Configuration action.this
.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 exe 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 exe
.
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 exe to use.
If you need to search the system path, to find the exe use the search : 'exeName'
form instead.
exe
- Anything that can be resolved via StringUtils.stringize
or an implementation of ResolvableExecutableSet the exe to use.
exe
- An implementation of ResolvableExecutable Use a key-value approach to setting the exe.
In the default implementation only path
and search
are supported as a declarative keys.
Implementations should use ResolverFactoryRegistry to add more keys.
exe
- Key-value setting exe (with optional extra keys)Returns the full script line, including the exe, it's specific arguments, tool specific instruction and the arguments specific to the instruction.
Any arguments specific to the tool in use
The exe used in this specification as a String.
Access to the object that can resolve exe location from property maps.
List of arguments specific to the tool instruction.
Lazy-evaluated version of the exe
null
if not configured.A specific instruction passed to a tool. * Instruction can be empty or null. In the default implementation getToolInstruction 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 exe to use.
If you need to search the system path, to find the exe use the search : 'exeName'
form instead.
exe
- Anything that can be resolved via StringUtils.stringize
or an implementation of ResolvableExecutableSet the exe to use.
exe
- An implementation of ResolvableExecutableSet the exe to use.
exe
- An implementation of ResolvableExecutableSet the exe 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 exe.
In the default implementation only path
and search
are supported as a declarative keys.
Implementations should use ResolverFactoryRegistry to add more keys.
exe
- Key-value setting exe (with optional extra keys)Replace the instruction-specific arguments with a new set.
args
- New list of instruction-specific argumentsGroovy Documentation