invokeWhenCreated

abstract fun <T : Named> NamedDomainObjectContainer<T>.invokeWhenCreated(name: String, configure: T.() -> Unit)

Can be used to configure objects that are not yet created, or will be created in 'afterEvaluate' (for example, typically for Android source sets containing flavors and buildTypes).

Will fail project evaluation if the domain object is not created before 'afterEvaluate' listeners in the buildscript.

Parameters

configure

Called inline if the value is already present. Called once the domain object is created.