@Incubating @NonExtensible interface PluginManager
Facilitates applying plugins and determining which plugins have been applied to a PluginAware object.
See Also
PluginAware
Since
2.3
abstract fun apply(pluginId: String): Unit
Applies the plugin with the given ID. Does nothing if the plugin has already been applied. Plugins in the
abstract fun apply(type: Class<*>): Unit
Applies the given plugin. Does nothing if the plugin has already been applied. The given class should implement the org.gradle.api.Plugin interface, and be parameterized for a compatible type of The following two lines are equivalent…
|
|
abstract fun findPlugin(id: String): AppliedPlugin
Returns the information about the plugin that has been applied with the given ID, or null if no plugin has been applied with the given ID. Plugins in the Some Gradle plugins have not yet migrated to fully qualified plugin IDs. Such plugins can be detected with this method by simply using the unqualified ID (e.g. |
|
abstract fun hasPlugin(id: String): Boolean
Returns |
|
abstract fun withPlugin(id: String, action: Action<in AppliedPlugin>): Unit
Executes the given action when the specified plugin is applied. If a plugin with the specified ID has already been applied, the supplied action will be executed immediately. Otherwise, the action will executed immediately after a plugin with the specified ID is applied. The given action is always executed after the plugin has been applied. |