Search in sources :

Example 1 with ComponentOverrideMetadata

use of org.gradle.internal.component.model.ComponentOverrideMetadata in project gradle by gradle.

the class ComponentState method resolve.

public void resolve() {
    if (alreadyResolved()) {
        return;
    }
    ComponentOverrideMetadata componentOverrideMetadata;
    if (selectors != null && selectors.size() > 0) {
        // Taking the first selector here to determine the 'changing' status and 'client module' is our best bet to get the selector that will most likely be chosen in the end.
        // As selectors are sorted accordingly (see ModuleSelectors.SELECTOR_COMPARATOR).
        SelectorState firstSelector = selectors.first();
        componentOverrideMetadata = DefaultComponentOverrideMetadata.forDependency(firstSelector.isChanging(), selectors.getFirstDependencyArtifact(), firstSelector.getClientModule());
    } else {
        componentOverrideMetadata = DefaultComponentOverrideMetadata.EMPTY;
    }
    DefaultBuildableComponentResolveResult result = new DefaultBuildableComponentResolveResult();
    if (tryResolveVirtualPlatform()) {
        return;
    }
    resolver.resolve(componentIdentifier, componentOverrideMetadata, result);
    if (result.getFailure() != null) {
        metadataResolveFailure = result.getFailure();
        return;
    }
    metadata = result.getMetadata();
}
Also used : ComponentOverrideMetadata(org.gradle.internal.component.model.ComponentOverrideMetadata) DefaultComponentOverrideMetadata(org.gradle.internal.component.model.DefaultComponentOverrideMetadata) DefaultBuildableComponentResolveResult(org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult)

Aggregations

ComponentOverrideMetadata (org.gradle.internal.component.model.ComponentOverrideMetadata)1 DefaultComponentOverrideMetadata (org.gradle.internal.component.model.DefaultComponentOverrideMetadata)1 DefaultBuildableComponentResolveResult (org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult)1