@Incubating abstract fun <T : Any> add(publicType: Class<T>, name: String, extension: T): Unit
@Incubating abstract fun <T : Any> add(publicType: TypeOf<T>, name: String, extension: T): Unit
Adds a new extension to this container. Adding an extension of name 'foo' will:
publicType
.
publicType
- The extension public type
name
- The name for the extension
extension
- Any object implementing publicType
IllegalArgumentException
- When an extension with the given name already exists.
Since
3.5
abstract fun add(name: String, extension: Any): Unit
Adds a new extension to this container. Adding an extension of name 'foo' will:
extension.getClass()
unless the extension itself declares a preferred public type via the org.gradle.api.reflect.HasPublicType protocol.
name
- The name for the extension
IllegalArgumentException
- When an extension with the given name already exists