gradle
8.2

# DisambiguationRuleChain

interface DisambiguationRuleChain<T>

A chain of disambiguation rules. By default the chain is empty and will not do any disambiguation.

For a given set of rules, the execution is done in order, and interrupts as soon as a rule selected at least one candidate (through closestMatch).

If the end of the rule chain is reached and that no rule selected a candidate then the candidate list is returned unmodified, meaning we still have an ambiguous match.

#### Parameters

<T>

the concrete type of the attribute

## Functions

add
Link copied to clipboard
abstract fun add(rule: Class<out AttributeDisambiguationRule<T>>)
Adds an arbitrary disambiguation rule to the chain.
abstract fun add(rule: Class<out AttributeDisambiguationRule<T>>, configureAction: Action<out Any>)
Adds an arbitrary disambiguation rule to the chain, possibly configuring the rule as well.
add
Link copied to clipboard
inline fun <T : Any> DisambiguationRuleChain<T>.add(rule: KClass<out AttributeDisambiguationRule<T>>)
inline fun <T : Any> DisambiguationRuleChain<T>.add(rule: KClass<out AttributeDisambiguationRule<T>>, configureAction: Action<in ActionConfiguration>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.attributes.DisambiguationRuleChain.add.

pickFirst
Link copied to clipboard
abstract fun pickFirst(comparator: Comparator<out Any>)
Adds an ordered disambiguation rule.
pickLast
Link copied to clipboard
abstract fun pickLast(comparator: Comparator<out Any>)
Adds an ordered disambiguation rule.