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

apply

fun PluginAware.apply(from: Any? = null, plugin: String? = null, to: Any? = null): Unit

Applies the given plugin or script.

Parameters

from - a script to apply, evaluated as per Project.file

plugin - a id of the plugin to apply

to - the plugin target object or collection of objects, target is self when null

See Also

PluginAware.apply

inline fun <reified T : Plugin<*>> PluginAware.apply(): Unit

Applies the plugin of the given type T. Does nothing if the plugin has already been applied.

The given class should implement the Plugin interface.

Parameters

T - the plugin type.

See Also

PluginAware.apply

inline fun <reified T : Plugin<*>> PluginAware.apply(to: Any): Unit

Applies the plugin of the given type T to the specified object. Does nothing if the plugin has already been applied.

The given class should implement the Plugin interface.

Parameters

T - the plugin type.

to - the plugin target object or collection of objects

See Also

PluginAware.apply