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.

ComponentSpecContainer

Deprecated

The Gradle software model is deprecated and will be removed in Gradle 10. Use the new component model (e.g. cpp-application, cpp-library, swift-application, swift-library, xctest) instead.

A container of software components.

Since

2.2

Functions

Link copied to clipboard
abstract fun afterEach(configAction: Action<in T>)
Applies the given action to each item in the collection, as each item is required.
abstract fun <S> afterEach(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in the collection, as each item is required.
Link copied to clipboard
inline fun <S : Any, T : Any> ModelMap<T>.afterEach(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.afterEach.

Link copied to clipboard
abstract fun all(configAction: Action<in T>)
Applies the given action to each item in the collection, as each item is required.
Link copied to clipboard
abstract fun beforeEach(configAction: Action<in T>)
Applies the given action to each item in this collection, as each item is required.
abstract fun <S> beforeEach(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in this collection, as each item is required.
Link copied to clipboard
inline fun <S : Any, T : Any> ModelMap<T>.beforeEach(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.beforeEach.

Link copied to clipboard
abstract fun containsKey(name: Any): Boolean
Returns true if this collection contains an item with the given name.
Link copied to clipboard
abstract fun containsValue(item: Any): Boolean
Returns true if this collection contains the given item.
Link copied to clipboard
abstract fun create(name: String)
abstract fun create(name: String, configAction: Action<in T>)
Defines an item with the given name and type T.
abstract fun <S : T?> create(name: String, type: Class<S>)
abstract fun <S : T?> create(name: String, type: Class<S>, configAction: Action<in S>)
Defines an item with the given name and type.
Link copied to clipboard
inline fun <S : T, T : Any> ModelMap<T>.create(name: String, type: KClass<S>)
inline fun <S : T, T : Any> ModelMap<T>.create(name: String, type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.create.

Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard
@Nullable
abstract fun get(name: Any): @Nullable T
@Nullable
abstract fun get(name: String): @Nullable T
Returns the item with the given name, if any.
Link copied to clipboard
abstract fun getDisplayName(): String
Returns a human-consumable display name for this element.
Link copied to clipboard
abstract fun getName(): String
Returns the name of this element.
Link copied to clipboard
abstract fun isEmpty(): Boolean
Returns true if this collection contains no items.
Link copied to clipboard
abstract fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun keySet(): Set<String>
Returns the names of the items in this collection.
Link copied to clipboard
abstract fun named(name: String, ruleSource: Class<out RuleSource>)
Applies the given rule source class to the given item, when the item is required.
abstract fun named(name: String, configAction: Action<in T>)
Applies the given action to the given item, when the item is required.
Link copied to clipboard
inline fun <T : Any> ModelMap<T>.named(name: String, ruleSource: KClass<out RuleSource>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.named.

Link copied to clipboard
abstract fun put(name: String, instance: T)
Adds an element to this ModelMap.
Link copied to clipboard
abstract fun size(): Int
Returns the number of items in this collection.
Link copied to clipboard
Link copied to clipboard
abstract fun values(): Collection<T>
Returns the items in this collection.
Link copied to clipboard
abstract fun <S> withType(type: Class<S>): ModelMap<S>
Returns a collection containing the items from this collection which are of the specified type.
abstract fun <S> withType(type: Class<S>, rules: Class<out RuleSource>)
Applies the given rules to all items of the collection of the given type.
abstract fun <S> withType(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in the collection, as each item is required.
Link copied to clipboard
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>): ModelMap<S>
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.withType.