TaskContainer

A TaskContainer is responsible for managing a set of Task instances.

You can obtain a TaskContainer instance by calling getTasks, or using the tasks property in your build script.

Properties

Link copied to clipboard

Provides a property delegate that creates elements of the default collection type.

Functions

Link copied to clipboard
abstract fun add(e: T): Boolean
Link copied to clipboard
abstract fun addAll(c: Collection<out T>): Boolean
Link copied to clipboard
abstract fun addAllLater(provider: Provider<out Iterable<T>>)
Link copied to clipboard
abstract fun addLater(provider: Provider<out T>)
Link copied to clipboard
abstract fun addRule(rule: Rule): Rule
Link copied to clipboard
abstract fun all(action: Action<in T>)
Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract fun configure(configureClosure: Closure): NamedDomainObjectContainer<T>
abstract fun configure(cl: Closure): T
Link copied to clipboard
abstract fun configureEach(action: Action<in T>)
Link copied to clipboard
Link copied to clipboard

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.PolymorphicDomainObjectContainer.containerWithType.

Link copied to clipboard
abstract fun contains(p: Any): Boolean
Link copied to clipboard
abstract fun containsAll(p: Collection<out Any>): Boolean
Link copied to clipboard
open fun <E> copyOf(coll: Collection<out E>): Set<E>
Link copied to clipboard
abstract fun create(name: String): Task
Creates a Task with the given name and adds it to this container.
abstract fun create(options: Map<String, out Any>): Task
Creates a Task and adds it to this container.
abstract fun create(name: String, configureClosure: Closure): Task
Creates a Task with the given name adds it to this container.
abstract fun <T : Task?> create(name: String, type: Class<T>): T
Creates a Task with the given name and type, and adds it to this container.
abstract fun create(options: Map<String, out Any>, configureClosure: Closure): Task
Creates a Task adds it to this container.
abstract fun <T : Task?> create(name: String, type: Class<T>, constructorArgs: Array<Any>): T
Creates a Task with the given name and type, passing the given arguments to the @Inject-annotated constructor, and adds it to this container.
abstract fun <T : Task?> create(name: String, type: Class<T>, configuration: Action<in T>): T
Creates a Task with the given name and type, configures it with the given action, and adds it to this container.
Link copied to clipboard

Creates a domain object with the specified name and type, and adds it to the container.

inline fun TaskContainer.create(vararg options: Pair<String, Any?>): Task

Kotlin extension function for org.gradle.api.tasks.TaskContainer.create.

inline fun <U : Any> PolymorphicDomainObjectContainer<in U>.create(name: String, noinline configuration: U.() -> Unit): U

Creates a domain object with the specified name and type, adds it to the container, and configures it with the specified action.

inline fun <U : T, T : Any> PolymorphicDomainObjectContainer<T>.create(name: String, type: KClass<U>): U
inline fun <U : T, T : Any> PolymorphicDomainObjectContainer<T>.create(name: String, type: KClass<U>, configuration: Action<in U>): U

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.PolymorphicDomainObjectContainer.create.

inline fun <T : Task> TaskContainer.create(name: String, vararg arguments: Any): T

Creates a Task with the given name and type, passing the given arguments to the javax.inject.Inject-annotated constructor, and adds it to this project tasks container.

inline fun <T : Task> TaskContainer.create(name: String, type: KClass<T>): T
inline fun <T : Task> TaskContainer.create(name: String, type: KClass<T>, vararg constructorArgs: Any): T
inline fun <T : Task> TaskContainer.create(name: String, type: KClass<T>, configuration: Action<in T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskContainer.create.

Link copied to clipboard

Provides a property delegate that creates elements of the default collection type with the given configuration.

Provides a property delegate that creates elements of the given type.

Provides a property delegate that creates elements of the given type expressed as a java.lang.Class with the given configuration.

Provides a property delegate that creates elements of the given type with the given configuration.

Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun findAll(spec: Closure): Collection<T>
abstract fun findAll(spec: Closure): Set<T>
Link copied to clipboard
abstract fun findByName(name: String): T
Link copied to clipboard
@Nullable
abstract fun findByPath(path: String): Task
Locates a task by path.
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard
operator fun <T : Any> NamedDomainObjectCollection<T>.get(name: String): T

Locates an object by name, failing if there is no such object.

Link copied to clipboard
abstract fun getAsMap(): SortedMap<String, T>
Link copied to clipboard
abstract fun getAt(name: String): T
Link copied to clipboard
abstract fun getByName(name: String, configureClosure: Closure): T
Link copied to clipboard
inline fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String): T

Locates an object by name and casts it to the expected type T.

inline fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, configure: T.() -> Unit): T

Locates an object by name and casts it to the expected type T then configures it.

Locates an object by name and casts it to the expected type.

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, type: KClass<T>, configure: T.() -> Unit): T

Locates an object by name and casts it to the expected type then configures it.

Link copied to clipboard
abstract fun getByPath(path: String): Task
Locates a task by path.
Link copied to clipboard
Link copied to clipboard
abstract fun getNamer(): Namer<T>
Link copied to clipboard
abstract fun getNames(): SortedSet<String>
Link copied to clipboard
abstract fun getRules(): List<Rule>
Link copied to clipboard

Provides a property delegate that gets elements of the given type.

Provides a property delegate that gets elements of the given type and applies the given configuration.

Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
inline operator fun TaskContainer.invoke(configuration: TaskContainerScope.() -> Unit): TaskContainer

Allows a TaskContainer to be configured via an augmented DSL that includes a shorthand string notation for configuring existing tasks.

Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract fun iterator(): Iterator<T>
abstract fun iterator(): Iterator<E>
Link copied to clipboard
abstract fun matching(spec: Spec<in T>): DomainObjectCollection<T>
abstract fun matching(spec: Spec<in T>): DomainObjectSet<T>
abstract fun matching(spec: Spec<in T>): NamedDomainObjectCollection<T>
abstract fun matching(spec: Spec<in T>): NamedDomainObjectSet<T>
abstract fun matching(spec: Spec<in T>): TaskCollection<T>
Link copied to clipboard
abstract fun maybeCreate(name: String): T
abstract fun <U : T?> maybeCreate(name: String, type: Class<U>): U
Link copied to clipboard

Creates a domain object with the specified name and type if it does not exists, and adds it to the container.

inline fun <U : T, T : Any> PolymorphicDomainObjectContainer<T>.maybeCreate(name: String, type: KClass<U>): U

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.PolymorphicDomainObjectContainer.maybeCreate.

Link copied to clipboard
abstract fun named(name: String): NamedDomainObjectProvider<T>
open fun named(nameFilter: Spec<String>): NamedDomainObjectCollection<T>
abstract fun <S : T?> named(name: String, type: Class<S>): NamedDomainObjectProvider<S>
abstract fun named(nameFilter: Spec<String>): NamedDomainObjectSet<T>
abstract fun named(name: String): TaskProvider<T>
abstract fun named(nameFilter: Spec<String>): TaskCollection<T>
abstract fun <S : T?> named(name: String, type: Class<S>): TaskProvider<S>
Link copied to clipboard

Locates an object by name and type, without triggering its creation or configuration, failing if there is no such object.

inline fun <T : Task> TaskCollection<out Task>.named(name: String): TaskProvider<T>
fun <T : Task> TaskCollection<out Task>.named(name: String, type: KClass<T>): TaskProvider<T>

Locates a task by name and type, without triggering its creation or configuration, failing if there is no such task.

inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.named(name: String, type: KClass<S>, configurationAction: Action<in S>): NamedDomainObjectProvider<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectCollection.named.

inline fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String, noinline configuration: T.() -> Unit): NamedDomainObjectProvider<T>
fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String, type: KClass<T>, configuration: T.() -> Unit): NamedDomainObjectProvider<T>

Configures an object by name and type, without triggering its creation or configuration, failing if there is no such object.

inline fun <S : T, T : Task> TaskCollection<T>.named(name: String, type: KClass<S>): TaskProvider<S>
inline fun <S : T, T : Task> TaskCollection<T>.named(name: String, type: KClass<S>, configurationAction: Action<in S>): TaskProvider<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskCollection.named.

inline fun <T : Task> TaskCollection<out Task>.named(name: String, noinline configuration: T.() -> Unit): TaskProvider<T>
fun <T : Task> TaskCollection<out Task>.named(name: String, type: KClass<T>, configuration: T.() -> Unit): TaskProvider<T>

Configures a task by name and type, without triggering its creation or configuration, failing if there is no such task.

Link copied to clipboard
open fun <E> of(): Set<E>
Link copied to clipboard
open fun parallelStream(): Stream<E>
Link copied to clipboard

Allows a NamedDomainObjectCollection to be used as a property delegate.

Link copied to clipboard
abstract fun register(name: String): TaskProvider<Task>
abstract fun <T : Task?> register(name: String, type: Class<T>): TaskProvider<T>
Defines a new task, which will be created when it is required.
abstract fun register(name: String, configurationAction: Action<in Task>): TaskProvider<Task>
abstract fun <T : Task?> register(name: String, type: Class<T>, configurationAction: Action<in T>): TaskProvider<T>
Defines a new task, which will be created and configured when it is required.
abstract fun <T : Task?> register(name: String, type: Class<T>, constructorArgs: Array<Any>): TaskProvider<T>
Defines a new task, which will be created when it is required passing the given arguments to the @Inject-annotated constructor.
Link copied to clipboard

Defines a new object, which will be created when it is required.

inline fun <T : Task> TaskContainer.register(name: String): TaskProvider<T>

Defines a new task, which will be created when it is required.

inline fun <T : Any> PolymorphicDomainObjectContainer<in T>.register(name: String, noinline configuration: T.() -> Unit): NamedDomainObjectProvider<T>

Defines and configure a new object, which will be created when it is required.

inline fun <U : T, T : Any> PolymorphicDomainObjectContainer<T>.register(name: String, type: KClass<U>, configurationAction: Action<in U>): NamedDomainObjectProvider<U>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.PolymorphicDomainObjectContainer.register.

inline fun <T : Task> TaskContainer.register(name: String, vararg arguments: Any): TaskProvider<T>

Defines a new task, which will be created when it is required passing the given arguments to the javax.inject.Inject-annotated constructor.

inline fun <T : Task> TaskContainer.register(name: String, noinline configuration: T.() -> Unit): TaskProvider<T>

Defines and configure a new task, which will be created when it is required.

inline fun <T : Task> TaskContainer.register(name: String, type: KClass<T>): TaskProvider<T>
inline fun <T : Task> TaskContainer.register(name: String, type: KClass<T>, vararg constructorArgs: Any): TaskProvider<T>
inline fun <T : Task> TaskContainer.register(name: String, type: KClass<T>, configurationAction: Action<in T>): TaskProvider<T>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskContainer.register.

Link copied to clipboard
abstract fun remove(p: Any): Boolean
Link copied to clipboard
abstract fun removeAll(p: Collection<out Any>): Boolean
Link copied to clipboard
open fun removeIf(filter: Predicate<in E>): Boolean
Link copied to clipboard
abstract fun replace(name: String): Task
Creates a Task with the given name and adds it to this container, replacing any existing task with the same name.
abstract fun <T : Task?> replace(name: String, type: Class<T>): T
Creates a Task with the given name and type, and adds it to this container, replacing any existing task of the same name.
Link copied to clipboard
inline fun <T : Task> TaskContainer.replace(name: String, type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskContainer.replace.

Link copied to clipboard
abstract fun retainAll(p: Collection<out Any>): Boolean
Link copied to clipboard
abstract fun size(): Int
Link copied to clipboard
Link copied to clipboard
open fun stream(): Stream<E>
Link copied to clipboard
abstract fun toArray(): Array<Any>
abstract fun <T> toArray(p: Array<T>): Array<T>
Link copied to clipboard
abstract fun whenObjectAdded(action: Closure)
abstract fun whenObjectAdded(action: Action<in T>): Action<in T>
Link copied to clipboard
abstract fun whenObjectRemoved(action: Closure)
abstract fun whenObjectRemoved(action: Action<in T>): Action<in T>
Link copied to clipboard
abstract fun whenTaskAdded(closure: Closure)
abstract fun whenTaskAdded(action: Action<in T>): Action<in T>
Link copied to clipboard
abstract fun <S : T?> withType(type: Class<S>): DomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>): DomainObjectSet<S>
abstract fun <S : T?> withType(type: Class<S>): NamedDomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>): NamedDomainObjectSet<S>
abstract fun <S : T?> withType(type: Class<S>): TaskCollection<S>
Link copied to clipboard
inline fun <S : Task> TaskCollection<in S>.withType(): TaskCollection<S>

Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

inline fun <S : Any> DomainObjectCollection<in S>.withType(noinline configuration: S.() -> Unit): DomainObjectCollection<S>

Returns a collection containing the objects in this collection of the given type. Equivalent to calling withType(type).all(configureAction).

inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>, configureAction: Action<in S>): DomainObjectCollection<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectCollection.withType.

inline fun <S : T, T : Any> DomainObjectSet<T>.withType(type: KClass<S>): DomainObjectSet<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectSet.withType.

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectCollection.withType.

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectSet.withType.

inline fun <S : T, T : Task> TaskCollection<T>.withType(type: KClass<S>): TaskCollection<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskCollection.withType.