api / org.gradle.api.plugins / PluginManager / withPlugin

withPlugin

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.

Parameters

id - the plugin ID. See #findPlugin(String) for details about this parameter.

action - the action to execute if/when the plugin is applied

Since
2.3