Search in sources :

Example 1 with ResolutionResult

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

the class DefaultIdeDependencyResolver method getUnresolvedIdeRepoFileDependencies.

/**
     * Gets unresolved IDE repository file dependencies.
     *
     * @param configuration Configuration
     * @return Unresolved IDE repositoru file dependencies
     */
public List<UnresolvedIdeRepoFileDependency> getUnresolvedIdeRepoFileDependencies(Configuration configuration) {
    ResolutionResult result = getIncomingResolutionResult(configuration);
    List<UnresolvedDependencyResult> unresolvedDependencies = findAllUnresolvedDependencyResults(result.getRoot().getDependencies());
    List<UnresolvedIdeRepoFileDependency> unresolvedIdeRepoFileDependencies = new ArrayList<UnresolvedIdeRepoFileDependency>();
    for (UnresolvedDependencyResult unresolvedDependencyResult : unresolvedDependencies) {
        Throwable failure = unresolvedDependencyResult.getFailure();
        ComponentSelector componentSelector = unresolvedDependencyResult.getAttempted();
        String displayName = componentSelector.getDisplayName();
        File file = new File(unresolvedFileName(componentSelector));
        unresolvedIdeRepoFileDependencies.add(new UnresolvedIdeRepoFileDependency(file, failure, displayName));
    }
    return unresolvedIdeRepoFileDependencies;
}
Also used : UnresolvedDependencyResult(org.gradle.api.artifacts.result.UnresolvedDependencyResult) ComponentSelector(org.gradle.api.artifacts.component.ComponentSelector) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) ArrayList(java.util.ArrayList) File(java.io.File)

Example 2 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) {
    Module module = configuration.getModule();
    ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(module);
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier);
    ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor(thisBuild.getCurrentBuild());
    results.graphResolved(emptyResult, emptyProjectResult, new EmptyResults());
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) 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 3 with ResolutionResult

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

the class DefaultTransformUpstreamDependenciesResolver method selectedArtifactsFor.

private FileCollectionInternal selectedArtifactsFor(ImmutableAttributes fromAttributes) {
    if (dependencies == null) {
        ResolutionResult result = resolutionResultProvider.getValue();
        dependencies = computeDependencies(componentIdentifier, ComponentIdentifier.class, result.getAllComponents(), false);
    }
    return filteredResultFactory.resultsMatching(fromAttributes, selectDependenciesWithId(dependencies));
}
Also used : ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier)

Example 4 with ResolutionResult

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

the class DefaultTransformUpstreamDependenciesResolver method computeDependenciesFor.

private void computeDependenciesFor(ImmutableAttributes fromAttributes, TaskDependencyResolveContext context) {
    if (buildDependencies == null) {
        ResolutionResult result = resolutionResultProvider.getTaskDependencyValue();
        buildDependencies = computeDependencies(componentIdentifier, ComponentIdentifier.class, result.getAllComponents(), true);
    }
    FileCollectionInternal files = filteredResultFactory.resultsMatching(fromAttributes, selectDependenciesWithId(buildDependencies));
    context.add(files);
}
Also used : ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) FileCollectionInternal(org.gradle.api.internal.file.FileCollectionInternal)

Example 5 with ResolutionResult

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

the class ErrorHandlingConfigurationResolver method resolveGraph.

@Override
public void resolveGraph(ConfigurationInternal configuration, ResolverResults results) throws ResolveException {
    try {
        delegate.resolveGraph(configuration, results);
    } catch (Exception e) {
        results.failed(wrapException(e, configuration));
        BrokenResolvedConfiguration broken = new BrokenResolvedConfiguration(e, configuration);
        results.artifactsResolved(broken, broken);
        return;
    }
    ResolutionResult wrappedResult = new ErrorHandlingResolutionResult(results.getResolutionResult(), configuration);
    results.graphResolved(wrappedResult, results.getResolvedLocalComponents(), results.getVisitedArtifacts());
}
Also used : ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) ResolveException(org.gradle.api.artifacts.ResolveException)

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