# PluginContainer

interface PluginContainer : PluginCollection<Plugin>

A `PluginContainer` is used to manage a set of org.gradle.api.Plugin instances applied to a particular project.

Plugins can be specified using either an id or type. The id of a plugin is specified using a META-INF/gradle-plugins/${id}.properties classpath resource.

## Functions

add
Link copied to clipboard
abstract fun add(p: E): Boolean
abstract fun add(plugin: T): Boolean
Unsupported.
addAll
Link copied to clipboard
abstract fun addAll(p: Collection<out E>): Boolean
abstract fun addAll(c: Collection<out T>): Boolean
Unsupported.
addAllLater
Link copied to clipboard
abstract fun addAllLater(provider: Provider<out Iterable<T>>)
Adds elements to this collection, given a Provider of Iterable that will provide the elements when required.
addLater
Link copied to clipboard
abstract fun addLater(provider: Provider<out T>)
Adds an element to this collection, given a Provider that will provide the element when required.
all
Link copied to clipboard
abstract fun all(action: Closure)
Executes the given closure against all objects in this collection, and any objects subsequently added to this collection.
abstract fun all(action: Action<in T>)
Executes the given action against all objects in this collection, and any objects subsequently added to this collection.
apply
Link copied to clipboard
abstract fun <T : Plugin?> apply(type: Class<T>): T
Applies a plugin to the project.
abstract fun apply(id: String): Plugin
Has the same behavior as apply except that the plugin is specified via its id.
apply
Link copied to clipboard
inline fun <T : Plugin<*>> PluginContainer. apply(type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.apply.

clear
Link copied to clipboard
abstract fun clear()
abstract fun clear()
Unsupported.
configureEach
Link copied to clipboard
abstract fun configureEach(action: Action<in T>)
Configures each element in this collection using the given action, as each element is required.
contains
Link copied to clipboard
abstract fun contains(p: Any): Boolean
containsAll
Link copied to clipboard
abstract fun containsAll(p: Collection<out Any>): Boolean
copyOf
Link copied to clipboard
open fun <E> copyOf(coll: Collection<out E>): Set<E>
disallowChanges
Link copied to clipboard
@Incubating
open fun disallowChanges()
Disallows further structural modifications to this collection.
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
findAll
Link copied to clipboard
abstract fun findAll(spec: Closure): Collection<T>
abstract fun findAll(spec: Closure): Set<T>
Returns a collection which contains the objects in this collection which meet the given closure specification.
findPlugin
Link copied to clipboard
@Nullable
abstract fun <T : Plugin?> findPlugin(type: Class<T>): @Nullable T
Returns the plugin for the given type.
@Nullable
abstract fun findPlugin(id: String): @Nullable Plugin
Returns the plugin for the given id.
findPlugin
Link copied to clipboard
inline fun <T : Plugin<*>> PluginContainer. findPlugin(type: KClass<T>): T?

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.findPlugin.

forEach
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
getAt
Link copied to clipboard
abstract fun <T : Plugin?> getAt(type: Class<T>): T
Returns a plugin with the specified type if this plugin has been used in the project.
abstract fun getAt(id: String): Plugin
Returns a plugin with the specified id if this plugin has been used in the project.
getAt
Link copied to clipboard
inline fun <T : Plugin<*>> PluginContainer. getAt(type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.getAt.

getElements
Link copied to clipboard
@Incubating
open fun getElements(): Provider<out Collection<T>>
Return a provider containing all elements added to this collection.
getPlugin
Link copied to clipboard
abstract fun <T : Plugin?> getPlugin(type: Class<T>): T
Returns a plugin with the specified type if this plugin has been used in the project.
abstract fun getPlugin(id: String): Plugin
Returns a plugin with the specified id if this plugin has been used in the project.
getPlugin
Link copied to clipboard
inline fun <T : Plugin<*>> PluginContainer. getPlugin(type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.getPlugin.

hashCode
Link copied to clipboard
abstract fun hashCode(): Int
hasPlugin
Link copied to clipboard
abstract fun hasPlugin(type: Class<out Plugin>): Boolean
Returns true if the container has a plugin with the given type, false otherwise.
abstract fun hasPlugin(id: String): Boolean
Returns true if the container has a plugin with the given id, false otherwise.
hasPlugin
Link copied to clipboard
inline fun PluginContainer. hasPlugin(type: KClass<out Plugin<*>>): Boolean

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.hasPlugin.

isEmpty
Link copied to clipboard
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
abstract fun iterator(): Iterator<T>
abstract fun iterator(): Iterator<E>
matching
Link copied to clipboard
abstract fun matching(spec: Closure): DomainObjectCollection<T>
abstract fun matching(spec: Closure): DomainObjectSet<T>
Returns a collection which contains the objects in this collection which meet the given closure specification.
abstract fun matching(spec: Spec<in T>): DomainObjectCollection<T>
abstract fun matching(spec: Spec<in T>): DomainObjectSet<T>
Returns a collection which contains the objects in this collection which meet the given specification.
abstract fun matching(closure: Closure): PluginCollection<T>
abstract fun matching(spec: Spec<in T>): PluginCollection<T>
of
Link copied to clipboard
open fun <E> of(): Set<E>
parallelStream
Link copied to clipboard
open fun parallelStream(): Stream<E>
remove
Link copied to clipboard
abstract fun remove(p: Any): Boolean
abstract fun remove(o: Any): Boolean
Unsupported.
removeAll
Link copied to clipboard
abstract fun removeAll(p: Collection<out Any>): Boolean
abstract fun removeAll(c: Collection<out Any>): Boolean
Unsupported.
removeIf
Link copied to clipboard
open fun removeIf(filter: Predicate<in E>): Boolean
retainAll
Link copied to clipboard
abstract fun retainAll(p: Collection<out Any>): Boolean
size
Link copied to clipboard
abstract fun size(): Int
spliterator
Link copied to clipboard
open fun spliterator(): Spliterator<T>
open fun spliterator(): Spliterator<E>
stream
Link copied to clipboard
open fun stream(): Stream<E>
toArray
Link copied to clipboard
abstract fun toArray(): Array<Any>
abstract fun <T> toArray(p: Array<T>): Array<T>
whenObjectAdded
Link copied to clipboard
abstract fun whenObjectAdded(action: Closure)
Adds a closure to be called when an object is added to this collection.
abstract fun whenObjectAdded(action: Action<in T>): Action<in T>
Adds an `Action` to be executed when an object is added to this collection.
whenObjectRemoved
Link copied to clipboard
abstract fun whenObjectRemoved(action: Closure)
Adds a closure to be called when an object is removed from this collection.
abstract fun whenObjectRemoved(action: Action<in T>): Action<in T>
Adds an `Action` to be executed when an object is removed from this collection.
whenPluginAdded
Link copied to clipboard
abstract fun whenPluginAdded(closure: Closure)
Adds a closure to be called when a plugin is added to this collection.
abstract fun whenPluginAdded(action: Action<in T>): Action<in T>
Adds an `Action` to be executed when a plugin is added to this collection.
withId
Link copied to clipboard
abstract fun withId(pluginId: String, action: Action<in Plugin>)
Executes or registers an action for a plugin with given id.
withType
Link copied to clipboard
abstract fun <S : T?> withType(type: Class<S>): DomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>, @DelegatesTo(genericTypeIndex = 0) configureClosure: Closure): DomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>, configureAction: Action<in S>): DomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>): DomainObjectSet<S>
Returns a collection containing the objects in this collection of the given type.
abstract fun <S : T?> withType(type: Class<S>): PluginCollection<S>
withType
Link copied to clipboard
inline fun <S : Any> DomainObjectCollection<in S>.withType(): DomainObjectCollection<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>): DomainObjectCollection<S>
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.

inline fun <S : T, T : Plugin<*>> PluginCollection<T>.withType(type: KClass<S>): PluginCollection<S>

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