gradle
8.4

# BinaryCollection

interface BinaryCollection<T : SoftwareComponent?>(source)

A collection of binaries that are created and configured as they are required.

Each element in this collection passes through several states. The element is created and becomes 'known'. The element is passed to any actions registered using whenElementKnown. The element is then configured using any actions registered using configureEach and becomes 'finalized'. The element is passed to any actions registered using whenElementFinalized. Elements are created and configured only when required.

#### Parameters

<T>

type of the elements in this container.

## Functions

configureEach
Link copied to clipboard
abstract fun configureEach(action: Action<out Any>)
Registers an action to execute to configure each element in the collection.
abstract fun <S> configureEach(type: Class<S>, action: Action<out Any>)
Registers an action to execute to configure each element of the given type in the collection.
configureEach
Link copied to clipboard
inline fun <S : Any, T : SoftwareComponent> BinaryCollection<T>.configureEach(type: KClass<S>, action: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.language.BinaryCollection.configureEach.

get
Link copied to clipboard
abstract fun get(): Set<T>
Returns the set of binaries from this collection.
abstract fun get(spec: Spec<out Any>): BinaryProvider<T>
Returns a Provider that contains the single binary matching the given specification.
abstract fun <S> get(type: Class<S>, spec: Spec<out Any>): BinaryProvider<S>
Returns a BinaryProvider that contains the single binary matching the specified type and specification.
get
Link copied to clipboard
inline fun <S : Any, T : SoftwareComponent> BinaryCollection<T>.get(type: KClass<S>, spec: Spec<in S>): BinaryProvider<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.language.BinaryCollection.get.

getByName
Link copied to clipboard
abstract fun getByName(name: String): BinaryProvider<T>
Returns a BinaryProvider that contains the single binary with the given name.
whenElementFinalized
Link copied to clipboard
abstract fun whenElementFinalized(action: Action<out Any>)
Registers an action to execute when an element is finalized.
abstract fun <S> whenElementFinalized(type: Class<S>, action: Action<out Any>)
Registers an action to execute when an element of the given type is finalized.
whenElementFinalized
Link copied to clipboard
inline fun <S : Any, T : SoftwareComponent> BinaryCollection<T>.whenElementFinalized(type: KClass<S>, action: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.language.BinaryCollection.whenElementFinalized.

whenElementKnown
Link copied to clipboard
abstract fun whenElementKnown(action: Action<out Any>)
Registers an action to execute when an element becomes known.
abstract fun <S> whenElementKnown(type: Class<S>, action: Action<out Any>)
Registers an action to execute when an element of the given type becomes known.
whenElementKnown
Link copied to clipboard
inline fun <S : Any, T : SoftwareComponent> BinaryCollection<T>.whenElementKnown(type: KClass<S>, action: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.language.BinaryCollection.whenElementKnown.