api / org.gradle.kotlin.dsl / org.gradle.api.PolymorphicDomainObjectContainer

Extensions for org.gradle.api.PolymorphicDomainObjectContainer

create

fun <U : Any> PolymorphicDomainObjectContainer<in U>.create(name: String, configuration: U.() -> Unit): U

Creates a domain object with the specified name and type, adds it to the container, and configures it with the specified action.

fun <U : Any> PolymorphicDomainObjectContainer<in U>.create(name: String): U

Creates a domain object with the specified name and type, and adds it to the container.

creating

fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: KClass<U>): PolymorphicDomainObjectContainerDelegateProvider<T, U>

Provides a property delegate that creates elements of the given type.

fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: KClass<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerDelegateProvider<T, U>

Provides a property delegate that creates elements of the given type with the given configuration.

fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: Class<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerDelegateProvider<T, U>

Provides a property delegate that creates elements of the given type expressed as a java.lang.Class with the given configuration.

maybeCreate

fun <U : Any> PolymorphicDomainObjectContainer<in U>.maybeCreate(name: String): U

Creates a domain object with the specified name and type if it does not exists, and adds it to the container.