api / org.gradle.api / DomainObjectCollection / whenObjectAdded

whenObjectAdded

abstract fun whenObjectAdded(action: Action<in T>): Action<in T>

Adds an Action to be executed when an object is added to this collection.

Parameters

action - The action to be executed

Return
the supplied action

abstract fun whenObjectAdded(action: Closure<Any>): Unit

Adds a closure to be called when an object is added to this collection. The newly added object is passed to the closure as the parameter.

Parameters

action - The closure to be called