Creates a {@link Task} and adds it to this container. A map of creation options can be passed to this methodto control how the task is created. The following options are available:
Option | Description | Default Value |
---|---|---|
{@value org.gradle.api.Task#TASK_NAME} | The name of the task to create. | None. Must be specified. |
{@value org.gradle.api.Task#TASK_TYPE} | The class of the task to create. | {@link org.gradle.api.DefaultTask} |
{@value org.gradle.api.Task#TASK_ACTION} | The closure or {@link Action} toexecute when the task executes. See {@link Task#doFirst(Action)}. | null |
{@value org.gradle.api.Task#TASK_OVERWRITE} | Replace an existing task? | false |
{@value org.gradle.api.Task#TASK_DEPENDS_ON} | The dependencies of the task. See here for more details. | [] |
After the task is added, it is made available as a property of the project, so that you can reference the task by name in your build file. See here for more details.
If a task with the given name already exists in this container and the {@value org.gradle.api.Task#TASK_OVERWRITE}
option is not set to true, an exception is thrown.
|
|