Base class for an extension that can both be used on a project or a task.
Constructor and description |
---|
protected AbstractCombinedProjectTaskExtension
(Project project) Attach this extension to a project |
protected AbstractCombinedProjectTaskExtension
(Task task, String projectExtName) Attach this extension to a task |
Type Params | Return Type | Name and description |
---|---|---|
|
protected Project |
getProject() Project this extension is associated with. |
|
protected AbstractCombinedProjectTaskExtension |
getProjectExtension() Returns the extension that is attached to the project. |
|
protected Task |
getTask() Task this extension is attached to. |
|
Object |
getValue(groovy.lang.Closure getter) Uses a closure to resolve a value on a project extension or a task extension. |
|
Object |
getValueByMethod(String methodName) Uses reflection to invoke a method on a project extension or a task extension. |
Attach this extension to a project
project
- Project to attach to.Project this extension is associated with.
Returns the extension that is attached to the project.
Task this extension is attached to.
null
if extension is not attached to a task.Uses a closure to resolve a value on a project extension or a task extension. If the extension is attached to a task and the returned value is null, it will first try to resolve the value by the project extension.
null
.getter
- A closure which will be passed an extension object which is an implementation of AbstractCombinedProjectTaskExtension
.Uses reflection to invoke a method on a project extension or a task extension. If the extension is attached to a task and the returned value is null, it will first try to resolve the value by the project extension.
null
.methodName
- Method to invoke.