Use as a base class for extensions that will wrap tools.
This base class will also enable extensions to discover whether they are inside a task or a project.
- > THe extension class that extends this base class
Type | Name and description |
---|---|
Iterable<String> |
windowsExtensionSearchOrder |
Constructor and description |
---|
protected AbstractToolExtension
(ProjectOperations projectOperations) Attach this extension to a project |
protected AbstractToolExtension
(Task task, ProjectOperations projectOperations, T projectExtension) Attach this extension to a task |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
executableByPath(Object path) Locate an executable by a local path. |
|
void |
executableBySearchPath(Object baseName) Locate executable by searching the current environmental search path. |
|
void |
executableByVersion(Object version) Locate an executable by version, probably downloading it if not local. |
|
protected File |
executablePathOrNull() If a path has been set instead of a version, resolve the path. |
|
protected File |
executableSearchPathOrNull() If a search path has been set, resolve the location by searching path |
|
protected String |
executableVersionOrNull() Resolves the version if it has been set. |
|
protected ExecutableDownloader |
getDownloader() Gets the downloader implementation. |
|
Provider<File> |
getExecutable() A provider for a resolved executable. |
|
java.util.List<String> |
getWindowsExtensionSearchOrder() The order in which extensions will be checked for locating an executable on Windows. |
|
Provider<String> |
resolvedExecutableVersion() If configured by version returns that, otherwise it might run the executable to obtain the version. |
|
protected String |
runExecutableAndReturnVersion() Runs the executable and returns the version. |
|
void |
setWindowsExtensionSearchOrder(Iterable<String> order) When searching for executables, the order in which to use check for file extensions. |
|
void |
setWindowsExtensionSearchOrder(String... order) |
Methods inherited from class | Name |
---|---|
class CombinedProjectTaskExtensionBase |
getProjectExtension, getTask |
Attach this extension to a project
projectOperations
- ProjectOperations instance.Attach this extension to a task
task
- Task to attach to.projectOperations
- ProjectOperations instance.projectExtName
- Name of the extension that is attached to the project.Locate an executable by a local path.
path
- Something resolvable to a File.Locate executable by searching the current environmental search path.
baseName
- The base name of the executableLocate an executable by version, probably downloading it if not local.
version
- Something resolvable to a string.If a path has been set instead of a version, resolve the path.
null
If a search path has been set, resolve the location by searching path
null
if search path was not setResolves the version if it has been set.
null
.Gets the downloader implementation. Can throw an exception if downloading is not supported.
A provider for a resolved executable.
The order in which extensions will be checked for locating an executable on Windows.
The default is to use whatever is in the PATHEXT
environmental variable.
If configured by version returns that, otherwise it might run the executable to obtain the version.
Runs the executable and returns the version. See ExecUtils.parseVersionFromOutput as a helper to implement this method.
When searching for executables, the order in which to use check for file extensions.
order
- List of extensions.Groovy Documentation