Groovy Documentation

org.gradle.api.tasks
[Java] Interface TaskCollection

org.gradle.api.NamedDomainObjectCollection
  org.gradle.api.tasks.TaskCollection
      org.gradle.api.DomainObjectCollection
          org.gradle.api.NamedDomainObjectSet
              java.lang.Iterable
                  java.util.Collection
All Superinterfaces:
NamedDomainObjectCollection, DomainObjectCollection, NamedDomainObjectSet, Iterable, Collection

public interface TaskCollection
extends NamedDomainObjectSet

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

Parameters:
- The type of tasks which this collection contains.


Method Summary
Object getAt(String name)

{@inheritDoc}

Object getByName(String name, Closure configureClosure)

{@inheritDoc}

Object getByName(String name)

{@inheritDoc}

TaskCollection matching(Spec spec)

{@inheritDoc}

TaskCollection matching(Closure closure)

{@inheritDoc}

Action whenTaskAdded(Action action)

Adds an Action to be executed when a task is added to this collection.

void whenTaskAdded(Closure closure)

Adds a closure to be called when a task is added to this collection.

TaskCollection withType(Class type)

{@inheritDoc}

 
Methods inherited from interface NamedDomainObjectSet
findAll, matching, matching, withType
 
Methods inherited from interface NamedDomainObjectCollection
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules, matching, matching, withType
 
Methods inherited from interface Set
add, equals, hashCode, clear, contains, isEmpty, size, toArray, toArray, addAll, iterator, remove, containsAll, removeAll, retainAll
 

Method Detail

getAt

public Object getAt(String name)
{@inheritDoc}


getByName

public Object getByName(String name, Closure configureClosure)
{@inheritDoc}


getByName

public Object getByName(String name)
{@inheritDoc}


matching

public TaskCollection matching(Spec spec)
{@inheritDoc}


matching

public TaskCollection matching(Closure closure)
{@inheritDoc}


whenTaskAdded

@SuppressWarnings("UnusedDeclaration")
public Action whenTaskAdded(Action action)
Adds an Action to be executed when a task is added to this collection.
Parameters:
action - The action to be executed
Returns:
the supplied action


whenTaskAdded

@SuppressWarnings("UnusedDeclaration")
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.
Parameters:
closure - The closure to be called


withType

public TaskCollection withType(Class type)
{@inheritDoc}


 

Gradle API 1.8