DisambiguationRuleChain

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.

Functions

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<in ActionConfiguration>)
Adds an arbitrary disambiguation rule to the chain, possibly configuring the rule as well.
Link copied to clipboard
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.

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