Search in sources :

Example 1 with DefaultComponentSelection

use of org.gradle.api.internal.artifacts.DefaultComponentSelection in project gradle by gradle.

the class DefaultVersionedComponentChooser method isRejectedByRule.

@Nullable
private RejectedByRuleVersion isRejectedByRule(ModuleComponentIdentifier candidateIdentifier, Collection<SpecRuleAction<? super ComponentSelection>> rules, MetadataProvider metadataProvider) {
    ComponentSelectionInternal selection = new DefaultComponentSelection(candidateIdentifier, metadataProvider);
    rulesProcessor.apply(selection, rules, metadataProvider);
    if (selection.isRejected()) {
        return new RejectedByRuleVersion(candidateIdentifier, selection.getRejectionReason());
    }
    return null;
}
Also used : RejectedByRuleVersion(org.gradle.internal.resolve.RejectedByRuleVersion) DefaultComponentSelection(org.gradle.api.internal.artifacts.DefaultComponentSelection) ComponentSelectionInternal(org.gradle.api.internal.artifacts.ComponentSelectionInternal) Nullable(javax.annotation.Nullable)

Example 2 with DefaultComponentSelection

use of org.gradle.api.internal.artifacts.DefaultComponentSelection in project gradle by gradle.

the class DefaultVersionedComponentChooser method isRejectedByRules.

private boolean isRejectedByRules(ModuleComponentIdentifier candidateIdentifier, Collection<SpecRuleAction<? super ComponentSelection>> rules, MetadataProvider metadataProvider) {
    ComponentSelectionInternal selection = new DefaultComponentSelection(candidateIdentifier);
    rulesProcessor.apply(selection, rules, metadataProvider);
    return selection.isRejected();
}
Also used : DefaultComponentSelection(org.gradle.api.internal.artifacts.DefaultComponentSelection) ComponentSelectionInternal(org.gradle.api.internal.artifacts.ComponentSelectionInternal)

Aggregations

ComponentSelectionInternal (org.gradle.api.internal.artifacts.ComponentSelectionInternal)2 DefaultComponentSelection (org.gradle.api.internal.artifacts.DefaultComponentSelection)2 Nullable (javax.annotation.Nullable)1 RejectedByRuleVersion (org.gradle.internal.resolve.RejectedByRuleVersion)1