api / org.gradle.api.plugins / PluginAware / apply

apply

abstract fun apply(closure: Closure<Any>): Unit

Applies zero or more plugins or scripts.

The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application.

This method differs from #apply(java.util.Map) in that it allows methods of the configuration action to be invoked more than once.

Parameters

closure - the closure to configure an ObjectConfigurationAction with before “executing” it

See Also
#apply(java.util.Map)

abstract fun apply(action: Action<in ObjectConfigurationAction>): Unit

Applies zero or more plugins or scripts.

The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application.

This method differs from #apply(java.util.Map) in that it allows methods of the configuration action to be invoked more than once.

Parameters

action - the action to configure an ObjectConfigurationAction with before “executing” it

See Also
#apply(java.util.Map)

abstract fun apply(options: MutableMap<String, *>): Unit

Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied.

The given map is applied as a series of method calls to a newly created ObjectConfigurationAction. That is, each key in the map is expected to be the name of a method ObjectConfigurationAction and the value to be compatible arguments to that method.

The following options are available:

Parameters

options - the options to use to configure and ObjectConfigurationAction before “executing” it