gradle
8.4

# apply

inline fun <T : Plugin<Gradle>> Gradle.apply()(source)
inline fun <T : Plugin<Project>> Project.apply()(source)
inline fun <T : Plugin<Settings>> Settings.apply()(source)

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, and be parameterized for a compatible type of `this`.

#### Parameters

T

the plugin type.

#### See also

PluginAware.apply

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

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 <T : Plugin<*>> PluginAware.apply()(source)

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

infix fun PluginDependencySpec.apply(apply: Boolean): PluginDependencySpec(source)

Specifies whether the plugin should be applied to the current project. Otherwise it is only put on the project's classpath.

Infix version of PluginDependencySpec.apply.

inline fun PluginAware.apply(vararg options: Pair<String, Any?>)

Kotlin extension function for org.gradle.api.plugins.PluginAware.apply.

#### See also

PluginAware.apply

inline fun <T : Plugin<*>> PluginContainer.apply(type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginContainer.apply.

#### See also

PluginContainer.apply

inline fun PluginManager.apply(type: KClass<*>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginManager.apply.

#### See also

PluginManager.apply

inline fun Script.apply(vararg options: Pair<String, Any?>)

Kotlin extension function for org.gradle.api.Script.apply.

#### See also

Script.apply