For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

whenObjectAdded

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

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

Like all, this method will cause all objects in this container to be realized.

Return

the supplied action

Since

0.7

Parameters

action

The action to be executed


abstract fun whenObjectAdded(action: Closure)(source)

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.

Like all, this method will cause all objects in this container to be realized.

Since

0.7

Parameters

action

The closure to be called

See also