ExtensionContainer

Allows adding 'namespaced' DSL extensions to a target object.

Inheritors

Functions

Link copied to clipboard
abstract fun add(name: String, extension: Any)
abstract fun <T> add(publicType: Class<T>, name: String, extension: T)
abstract fun <T> add(publicType: TypeOf<T>, name: String, extension: T)
Adds a new extension to this container.
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.add(name: String, extension: T)

Adds a new extension to this container.

inline fun <T : Any> ExtensionContainer.add(publicType: KClass<T>, name: String, extension: T)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.ExtensionContainer.add.

Link copied to clipboard
abstract fun <T> configure(type: Class<T>, action: Action<in T>)
abstract fun <T> configure(type: TypeOf<T>, action: Action<in T>)
Looks for the extension of the specified type and configures it with the supplied action.
abstract fun <T> configure(name: String, action: Action<in T>)
Looks for the extension with the specified name and configures it with the supplied action.
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.configure(noinline action: T.() -> Unit)

Looks for the extension of the specified type and configures it with the supplied action.

inline fun <T : Any> ExtensionContainer.configure(type: KClass<T>, action: Action<in T>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.ExtensionContainer.configure.

Link copied to clipboard
abstract fun <T> create(name: String, type: Class<T>, constructionArguments: Array<Any>): T
abstract fun <T> create(publicType: Class<T>, name: String, instanceType: Class<out T>, constructionArguments: Array<Any>): T
abstract fun <T> create(publicType: TypeOf<T>, name: String, instanceType: Class<out T>, constructionArguments: Array<Any>): T
Creates and adds a new extension to this container.
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.create(name: String, vararg constructionArguments: Any): T

Creates and adds a new extension to this container.

inline fun <T : Any> ExtensionContainer.create(name: String, type: KClass<T>, vararg constructionArguments: Any): T
inline fun <T : Any> ExtensionContainer.create(publicType: KClass<T>, name: String, instanceType: KClass<out T>, vararg constructionArguments: Any): T
inline fun <T : Any> ExtensionContainer.create(publicType: TypeOf<T>, name: String, instanceType: KClass<out T>, vararg constructionArguments: Any): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.ExtensionContainer.create.

Link copied to clipboard
@Nullable
abstract fun findByName(name: String): Any
Looks for the extension of a given name.
Link copied to clipboard
@Nullable
abstract fun <T> findByType(type: Class<T>): T
@Nullable
abstract fun <T> findByType(type: TypeOf<T>): T
Looks for the extension of a given type (useful to avoid casting).
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.findByType(): T?

Looks for the extension of a given type.

inline fun <T : Any> ExtensionContainer.findByType(type: KClass<T>): T?

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.ExtensionContainer.findByType.

Link copied to clipboard
operator fun ExtensionContainer.get(name: String): Any

Looks for the extension of a given name. If none found it will throw an exception.

Link copied to clipboard
abstract fun getByName(name: String): Any
Looks for the extension of a given name.
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.getByName(name: String): T

Looks for the extension of a given name and casts it to the expected type T.

Link copied to clipboard
abstract fun <T> getByType(type: Class<T>): T
abstract fun <T> getByType(type: TypeOf<T>): T
Looks for the extension of a given type (useful to avoid casting).
Link copied to clipboard
inline fun <T : Any> ExtensionContainer.getByType(): T

Looks for the extension of a given type.

inline fun <T : Any> ExtensionContainer.getByType(type: KClass<T>): T

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.ExtensionContainer.getByType.

Link copied to clipboard
Provides access to the schema of all known extensions.
Link copied to clipboard
The extra properties extension in this extension container.
Link copied to clipboard
inline operator fun <T : Any> ExtensionContainer.getValue(thisRef: Any?, property: KProperty<*>): T

Delegated property getter that locates extensions.