gradle
8.2

# withPlugin

abstract fun withPlugin(id: String, action: Action<out Any>)

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 for details about this parameter.

action

the action to execute if/when the plugin is applied