# 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.

#### Since

4.5

#### Parameters

<T>

type of the elements in this container.

## Functions

configureEach
Link copied to clipboard
abstract fun configureEach(action: Action<in T>)
Registers an action to execute to configure each element in the collection.
abstract fun <S> configureEach(type: Class<S>, action: Action<in S>)
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<in T>): BinaryProvider<T>
Returns a Provider that contains the single binary matching the given specification.
abstract fun <S> get(type: Class<S>, spec: Spec<in S>): 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<in T>)
Registers an action to execute when an element is finalized.
abstract fun <S> whenElementFinalized(type: Class<S>, action: Action<in S>)
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<in T>)
Registers an action to execute when an element becomes known.
abstract fun <S> whenElementKnown(type: Class<S>, action: Action<in S>)
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.