Utilities dealing with the creating of tasks allowing for lazy creation of tasks
on Gradle 4.9+, but still use the standard Gradle TaskContainer.create
API methods
for earlier versions.
In this way plugin authors can maintain compatibility back to older versions of Gradle that does
not have lazy creation.
Type Params | Return Type | Name and description |
---|---|---|
|
static void |
configureByName(Project project, String name, Action<? super Task> configurator) Configures a task by name. |
|
static void |
configureByName(Project project, String name, groovy.lang.Closure configurator) Configures a task by name. |
|
static TaskProvider<DefaultTask> |
registerTask(Project project, String name) Depending on the version of Gradle creates or registers a new task. |
<T extends Task> |
static TaskProvider<T> |
registerTask(Project project, String name, Class<T> type) Depending on the version of Gradle creates or registers a new task. |
<T extends Task> |
static TaskProvider<T> |
registerTask(Project project, String name, Class<T> type, groovy.lang.Closure cfg) Depending on the version of Gradle creates or registers a new task. |
<T extends Task> |
static TaskProvider<T> |
registerTask(Project project, String name, Class<T> type, Action<? extends Task> cfg) Depending on the version of Gradle creates or registers a new task. |
<T extends Task> |
static TaskProvider<T> |
registerTask(Project project, String name, Class<T> type, Object... args) Depending on the version of Gradle creates or registers a new task. |
|
static TaskProvider |
taskByName(Project project, String name) Finds a task on the given project by name |
<T> |
static TaskProvider<? extends Task> |
taskByTypeAndName(Project project, Class type, String name) Finds a task by both type and name |
Methods inherited from class | Name |
---|---|
class TaskProvider |
configure, configure, configureByName, configureByName, configureEach, get, getName, registerTask, registerTask, registerTask, registerTask, registerTask, taskByName, taskByTypeAndName |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Configures a task by name. Depending on the version on Gradle this can be done in a lazy manner.
project
- Project the task is attached toname
- Name of the taskconfigurator
- Configuration closure.Configures a task by name. Depending on the version on Gradle this can be done in a lazy manner.
project
- Project the task is attached toname
- Name of the taskconfigurator
- Configuration closure.Depending on the version of Gradle creates or registers a new task.
project
- Project to attach task to.name
- Name of task to register.Depending on the version of Gradle creates or registers a new task.
project
- Project to attach task to.name
- Name of task to register.type
- Task type.Depending on the version of Gradle creates or registers a new task.
project
- Project to attach task to.name
- Name of task to register.type
- Task type.cfg
- Configuration closure.Depending on the version of Gradle creates or registers a new task.
project
- Project to attach task to.name
- Name of task to register.type
- Task type.action
- Configuration action.Depending on the version of Gradle creates or registers a new task.
project
- Project to attach task to.name
- Name of task to register.type
- Task type.args
- Task constructor arguments.Finds a task on the given project by name
project
- Project to query.name
- Name of task.Finds a task by both type and name
project
- Project to querytype
- Types to restrict query to.name
- Name of task.