Search in sources :

Example 11 with ResolutionResult

use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.

the class ShortCircuitEmptyConfigurationResolver method emptyGraph.

private void emptyGraph(ConfigurationInternal configuration, ResolverResults results, boolean verifyLocking) {
    if (verifyLocking && configuration.getResolutionStrategy().isDependencyLockingEnabled()) {
        DependencyLockingProvider dependencyLockingProvider = configuration.getResolutionStrategy().getDependencyLockingProvider();
        DependencyLockingState lockingState = dependencyLockingProvider.loadLockState(configuration.getName());
        if (lockingState.mustValidateLockState() && !lockingState.getLockedDependencies().isEmpty()) {
            // Invalid lock state, need to do a real resolution to gather locking failures
            delegate.resolveGraph(configuration, results);
            return;
        }
        dependencyLockingProvider.persistResolvedDependencies(configuration.getName(), Collections.emptySet(), Collections.emptySet());
    }
    Module module = configuration.getModule();
    ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(module);
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier, configuration.getAttributes());
    ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor(thisBuild);
    results.graphResolved(emptyResult, emptyProjectResult, EmptyResults.INSTANCE);
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DependencyLockingProvider(org.gradle.api.internal.artifacts.dsl.dependencies.DependencyLockingProvider) DependencyLockingState(org.gradle.api.internal.artifacts.dsl.dependencies.DependencyLockingState) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module) ResolvedLocalComponentsResult(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResult) ResolvedLocalComponentsResultGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)

Example 12 with ResolutionResult

use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.

the class DependencyInsightReportTask method getRootComponentProperty.

/**
 * The root component of the dependency graph to be inspected.
 *
 * @since 7.5
 */
@Input
@Optional
@Incubating
public Property<ResolvedComponentResult> getRootComponentProperty() {
    Configuration configuration = getConfiguration();
    if (!rootComponentProperty.isPresent() && configuration != null && getDependencySpec() != null) {
        configurationName = configuration.getName();
        configurationDescription = configuration.toString();
        configurationAttributes = configuration.getAttributes();
        ResolvableDependenciesInternal incoming = (ResolvableDependenciesInternal) configuration.getIncoming();
        ResolutionResult result = incoming.getResolutionResult(errorHandler);
        rootComponentProperty.set(result.getRootComponent());
    }
    return rootComponentProperty;
}
Also used : ResolvableDependenciesInternal(org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal) Configuration(org.gradle.api.artifacts.Configuration) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) Input(org.gradle.api.tasks.Input) UserInput(org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput) Optional(org.gradle.api.tasks.Optional) Incubating(org.gradle.api.Incubating)

Example 13 with ResolutionResult

use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.

the class AsciiDependencyReportRenderer method render.

@Override
public void render(Configuration configuration) {
    if (canBeResolved(configuration)) {
        ResolutionResult result = configuration.getIncoming().getResolutionResult();
        RenderableDependency root = new RenderableModuleResult(result.getRoot());
        renderNow(root);
    } else {
        renderNow(new UnresolvableConfigurationResult(configuration));
    }
}
Also used : RenderableDependency(org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableDependency) UnresolvableConfigurationResult(org.gradle.api.tasks.diagnostics.internal.graph.nodes.UnresolvableConfigurationResult) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) RenderableModuleResult(org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableModuleResult)

Aggregations

ResolutionResult (org.gradle.api.artifacts.result.ResolutionResult)13 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)5 RenderableDependency (org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableDependency)4 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)3 RenderableModuleResult (org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableModuleResult)3 UnresolvableConfigurationResult (org.gradle.api.tasks.diagnostics.internal.graph.nodes.UnresolvableConfigurationResult)3 ArrayList (java.util.ArrayList)2 ComponentSelector (org.gradle.api.artifacts.component.ComponentSelector)2 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)2 DependencyResult (org.gradle.api.artifacts.result.DependencyResult)2 ResolvedComponentResult (org.gradle.api.artifacts.result.ResolvedComponentResult)2 Module (org.gradle.api.internal.artifacts.Module)2 ResolvedLocalComponentsResult (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResult)2 ResolvedLocalComponentsResultGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)2 File (java.io.File)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 Incubating (org.gradle.api.Incubating)1 Project (org.gradle.api.Project)1