use of org.gradle.internal.component.model.AttributeMatcher in project gradle by gradle.
the class VariantAttributeMatchingCache method matchAttributes.
private boolean matchAttributes(AttributeContainer actual, AttributeContainer requested, boolean ignoreAdditionalActualAttributes) {
Map<AttributeContainer, Boolean> cache;
AttributeMatcher schemaToMatchOn;
if (ignoreAdditionalActualAttributes) {
if (requested.isEmpty()) {
return true;
}
schemaToMatchOn = schema.ignoreAdditionalProducerAttributes();
cache = getCache(requested).ignoreExtraActual;
} else {
// ignore additional requested
if (actual.isEmpty()) {
return true;
}
schemaToMatchOn = schema.ignoreAdditionalConsumerAttributes();
cache = getCache(requested).ignoreExtraRequested;
}
Boolean match = cache.get(actual);
if (match == null) {
match = schemaToMatchOn.isMatching(actual, requested);
cache.put(actual, match);
}
return match;
}
Aggregations