api / org.gradle.api.attributes / AttributeMatchingStrategy

AttributeMatchingStrategy

@Incubating interface AttributeMatchingStrategy<T : Any>

An attribute matching strategy is responsible for providing information about how an Attribute is matched during dependency resolution. In particular, it will tell if a value, provided by a consumer, is compatible with a value provided by a candidate.

Parameters

- the type of the attribute

Since
3.3

Functions

getCompatibilityRules

abstract fun getCompatibilityRules(): CompatibilityRuleChain<T>

getDisambiguationRules

abstract fun getDisambiguationRules(): DisambiguationRuleChain<T>

ordered

abstract fun ordered(comparator: Comparator<T>): Unit

A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the provided Comparator.

All provider values which are lower than or equal the consumer value are compatible. When disambiguating, it will pick the highest compatible value.

abstract fun ordered(pickLast: Boolean, comparator: Comparator<T>): Unit

A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the provided Comparator.

All provider values which are lower than or equal the consumer value are compatible.