api / org.gradle.language / BinaryCollection / whenElementKnown

whenElementKnown

abstract fun whenElementKnown(action: Action<in T>): Unit

Registers an action to execute when an element becomes known. The action is only executed for those elements that are required. Fails if any element has already been finalized.

Parameters

action - The action to execute for each element becomes known.

abstract fun <S : Any> whenElementKnown(type: Class<S>, action: Action<in S>): Unit

Registers an action to execute when an element of the given type becomes known. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.

Parameters

type - The type of element to select.

action - The action to execute for each element becomes known.