Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.tasks
Interface TaskCollection

    org.gradle.api.tasks.TaskCollection
      org.gradle.api.DomainObjectCollection

All Superinterfaces:
  DomainObjectCollection

    interface TaskCollection
    extends DomainObjectCollection

A `TaskCollection` contains a set of Task instances, and provides a number of query methods.

Method Summary
`void` | `allTasks(Action action)` Executes the given action against all tasks in this collection, and any tasks subsequently added to this collection.
`void` | `allTasks(Closure closure)` Executes the given closure against all tasks in this collection, and any tasks subsequently added to this collection.
`T` | `getAt(java.lang.String name)` {
`T` | `getByName(java.lang.String name, Closure configureClosure)` {
`T` | `getByName(java.lang.String name)` {
`TaskCollection` | `matching(Spec spec)` {
`Action` | `whenTaskAdded(Action action)` Adds an {
`void` | `whenTaskAdded(Closure closure)` Adds a closure to be called when a task is added to this collection.
`TaskCollection` | `withType(java.lang.Class type)` {

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
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll

Method Detail

### allTasks

    public void allTasks(Action action)

  Executes the given action against all tasks in this collection, and any tasks subsequently added to this collection.
  param:
    action The action to be executed

### allTasks

    public void allTasks(Closure closure)

  Executes the given closure against all tasks in this collection, and any tasks subsequently added to this collection.
  param:
    closure The closure to be called

### getAt

    public T getAt(java.lang.String name)

  {@inheritDoc}

### getByName

    public T getByName(java.lang.String name, Closure configureClosure)

  {@inheritDoc}

### getByName

    public T getByName(java.lang.String name)

  {@inheritDoc}

### matching

    public TaskCollection matching(Spec spec)

  {@inheritDoc}

### whenTaskAdded

    public Action whenTaskAdded(Action action)

  Adds an `Action` to be executed when a task is added to this collection.
  param:
    action The action to be executed
  return:
    the supplied action

### whenTaskAdded

    public void whenTaskAdded(Closure closure)

  Adds a closure to be called when a task is added to this collection. The task is passed to the closure as the parameter.
  param:
    closure The closure to be called

### withType

    public TaskCollection withType(java.lang.Class type)

  {@inheritDoc}

Groovy Documentation