|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.tasks.TaskContainerorg.gradle.api.tasks.TaskCollection
org.gradle.api.DomainObjectCollection
interface TaskContainer extends TaskCollection
A TaskContainer is responsible for managing a set of Task instances.
You can obtain a TaskContainer instance by calling org.gradle.api.Project#getTasks(), or using the tasks property in your build script.
Method Summary | |
---|---|
Task
|
add(Map options)
Creates a { |
Task
|
add(Map options, Closure configureClosure)
Creates a { |
Task
|
add(java.lang.String name, Closure configureClosure)
Creates a { |
Task
|
add(java.lang.String name)
Creates a { |
T
|
add(java.lang.String name, java.lang.Class type)
Creates a { |
Task
|
findByPath(java.lang.String path)
Locates a task by path. |
Task
|
getByPath(java.lang.String path)
Locates a task by path. |
Task
|
replace(java.lang.String name)
Creates a { same name. |
T
|
replace(java.lang.String name, java.lang.Class type)
Creates a { task of the same name. |
Methods inherited from interface TaskCollection | |
---|---|
allTasks, allTasks, getAt, getByName, getByName, matching, whenTaskAdded, whenTaskAdded, withType |
Methods inherited from interface DomainObjectCollection | |
---|---|
allObjects, allObjects, findAll, findByName, getAll, getAsMap, getAt, getByName, getByName, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, withType |
Methods inherited from interface java.lang.Iterable | |
---|---|
iterator |
Methods inherited from class java.lang.Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Method Detail |
---|
public Task add(Map options)
Creates a Task and adds it to this container. A map of creation options can be passed to this method to control how the task is created. The following options are available:
Option | Description | Default Value |
---|---|---|
{ | The name of the task to create. | None. Must be specified. |
{ | The class of the task to create. | org.gradle.api.DefaultTask |
{ | The closure or TaskAction to execute when the task executes. See Task#doFirst(Action). | null |
{ | Replace an existing task? | false |
{ | 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 override
option is not set
to true, an exception is thrown.
public Task add(Map options, Closure configureClosure)
Creates a Task adds it to this container. A map of creation options can be passed to this method to control how the task is created. See #add(java.util.Map) for the list of options available. The given closure is used to configure the task before it is returned by this method.
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.
public Task add(java.lang.String name, Closure configureClosure)
Creates a Task with the given name adds it to this container. The given closure is used to configure the task before it is returned by this method.
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.
public Task add(java.lang.String name)
Creates a Task with the given name and adds it to this container.
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.
public T add(java.lang.String name, java.lang.Class type)
Creates a Task with the given name and type, and adds it to this container.
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.
public Task findByPath(java.lang.String path)
Locates a task by path. You can supply a task name, a relative path, or an absolute path. Relative paths are interpreted relative to the project for this container. This method returns null if no task with the given path exists.
public Task getByPath(java.lang.String path)
Locates a task by path. You can supply a task name, a relative path, or an absolute path. Relative paths are interpreted relative to the project for this container. This method throws an exception if no task with the given path exists.
public Task replace(java.lang.String name)
Creates a Task with the given name and adds it to this container, replacing any existing task with the same name.
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.
public T replace(java.lang.String name, java.lang.Class type)
Creates a Task with the given name and type, and adds it to this container, replacing any existing task of the same name.
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.
Groovy Documentation