interface PluginContainer : PluginCollection<Plugin<Any>>
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.
abstract fun apply(id: String): Plugin<Any>
Has the same behavior as abstract fun <T : Plugin<Any>> apply(type: Class<T>): T
Applies a plugin to the project. This usually means that the plugin uses the project API to add and modify the state of the project. This method can be called an arbitrary number of times for a particular plugin type. The plugin will be actually used only the first time this method is called. |
|
abstract fun findPlugin(id: String): Plugin<Any>
Returns the plugin for the given id. abstract fun <T : Plugin<Any>> findPlugin(type: Class<T>): T
Returns the plugin for the given type. |
|
abstract fun getAt(id: String): Plugin<Any>
Returns a plugin with the specified id if this plugin has been used in the project. You can use the Groovy abstract fun <T : Plugin<Any>> getAt(type: Class<T>): T
Returns a plugin with the specified type if this plugin has been used in the project. You can use the Groovy |
|
abstract fun getPlugin(id: String): Plugin<Any>
Returns a plugin with the specified id if this plugin has been used in the project. abstract fun <T : Plugin<Any>> getPlugin(type: Class<T>): T
Returns a plugin with the specified type if this plugin has been used in the project. |
|
abstract fun hasPlugin(id: String): Boolean
Returns true if the container has a plugin with the given id, false otherwise. abstract fun hasPlugin(type: Class<out Plugin<Any>>): Boolean
Returns true if the container has a plugin with the given type, false otherwise. |
|
abstract fun withId(pluginId: String, action: Action<in Plugin<Any>>): Unit
Executes or registers an action for a plugin with given id. If the plugin was already applied, the action is executed. If the plugin is applied sometime later the action will be executed after the plugin is applied. If the plugin is never applied, the action is never executed. The behavior is similar to |
abstract fun add(element: T): Boolean
Unsupported. |
|
abstract fun addAll(elements: Collection<T>): Boolean
Unsupported. |
|
abstract fun clear(): Unit
Unsupported. |
|
abstract fun matching(spec: Spec<in T>): PluginCollection<T> abstract fun matching(closure: Closure<Any>): PluginCollection<T>
{@inheritDoc} |
|
abstract fun remove(o: T): Boolean
Unsupported. |
|
abstract fun removeAll(elements: Collection<T>): Boolean
Unsupported. |
|
abstract fun whenPluginAdded(action: Action<in T>): Action<in T>
Adds an abstract fun whenPluginAdded(closure: Closure<Any>): Unit
Adds a closure to be called when a plugin is added to this collection. The plugin is passed to the closure as the parameter. |
|
abstract fun <S : T> withType(type: Class<S>): PluginCollection<S>
{@inheritDoc} |