Java 类org.gradle.api.artifacts.result.UnresolvedDependencyResult 实例源码

项目:Reer    文件:DefaultIdeDependencyResolver.java   
/**
 * 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;
}
项目:Reer    文件:CachingDependencyResultFactory.java   
public UnresolvedDependencyResult createUnresolvedDependency(ComponentSelector requested, ResolvedComponentResult from,
                                                   ComponentSelectionReason reason, ModuleVersionResolveException failure) {
    List<Object> key = asList(requested, from);
    if (!unresolvedDependencies.containsKey(key)) {
        unresolvedDependencies.put(key, new DefaultUnresolvedDependencyResult(requested, reason, from, failure));
    }
    return unresolvedDependencies.get(key);
}
项目:Reer    文件:DependencyInsightReporter.java   
public Collection<RenderableDependency> prepare(Collection<DependencyResult> input, VersionSelectorScheme versionSelectorScheme, VersionComparator versionComparator) {
    LinkedList<RenderableDependency> out = new LinkedList<RenderableDependency>();
    List<DependencyEdge> dependencies = CollectionUtils.collect(input, new Transformer<DependencyEdge, DependencyResult>() {
        @Override
        public DependencyEdge transform(DependencyResult result) {
            if (result instanceof UnresolvedDependencyResult) {
                return new UnresolvedDependencyEdge((UnresolvedDependencyResult) result);
            } else {
                return new ResolvedDependencyEdge((ResolvedDependencyResult) result);
            }
        }
    });
    Collection<DependencyEdge> sorted = DependencyResultSorter.sort(dependencies, versionSelectorScheme, versionComparator);

    //remember if module id was annotated
    HashSet<ComponentIdentifier> annotated = new HashSet<ComponentIdentifier>();
    RequestedVersion current = null;

    for (DependencyEdge dependency : sorted) {
        //add description only to the first module
        if (annotated.add(dependency.getActual())) {
            //add a heading dependency with the annotation if the dependency does not exist in the graph
            if (!dependency.getRequested().matchesStrictly(dependency.getActual())) {
                out.add(new DependencyReportHeader(dependency));
                current = new RequestedVersion(dependency.getRequested(), dependency.getActual(), dependency.isResolvable(), null);
                out.add(current);
            } else {
                current = new RequestedVersion(dependency.getRequested(), dependency.getActual(), dependency.isResolvable(), getReasonDescription(dependency.getReason()));
                out.add(current);
            }
        } else if (!current.getRequested().equals(dependency.getRequested())) {
            current = new RequestedVersion(dependency.getRequested(), dependency.getActual(), dependency.isResolvable(), null);
            out.add(current);
        }

        current.addChild(dependency);
    }

    return out;
}
项目:Reer    文件:RenderableDependencyResult.java   
@Override
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : dependency.getSelected().getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Reer    文件:RenderableModuleResult.java   
@Override
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : module.getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Reer    文件:DefaultIdeDependencyResolver.java   
/**
 * Finds all unresolved dependency results.
 *
 * @param dependencies Unfiltered dependencies
 * @return Unresolved dependency results.
 */
private List<UnresolvedDependencyResult> findAllUnresolvedDependencyResults(Set<? extends DependencyResult> dependencies) {
    List<UnresolvedDependencyResult> unresolvedDependencyResults = new ArrayList<UnresolvedDependencyResult>();

    for (DependencyResult dependencyResult : dependencies) {
        if (dependencyResult instanceof UnresolvedDependencyResult) {
            unresolvedDependencyResults.add((UnresolvedDependencyResult) dependencyResult);
        }
    }

    return unresolvedDependencyResults;
}
项目:Pushjet-Android    文件:CachingDependencyResultFactory.java   
public UnresolvedDependencyResult createUnresolvedDependency(ComponentSelector requested, ResolvedComponentResult from,
                                                   ComponentSelectionReason reason, ModuleVersionResolveException failure) {
    List<Object> key = asList(requested, from);
    if (!unresolvedDependencies.containsKey(key)) {
        unresolvedDependencies.put(key, new DefaultUnresolvedDependencyResult(requested, reason, from, failure));
    }
    return unresolvedDependencies.get(key);
}
项目:Pushjet-Android    文件:RenderableDependencyResult.java   
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : dependency.getSelected().getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Pushjet-Android    文件:RenderableModuleResult.java   
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : module.getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Pushjet-Android    文件:RenderableDependencyResult.java   
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : dependency.getSelected().getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Pushjet-Android    文件:RenderableModuleResult.java   
public Set<RenderableDependency> getChildren() {
    Set<RenderableDependency> out = new LinkedHashSet<RenderableDependency>();
    for (DependencyResult d : module.getDependencies()) {
        if (d instanceof UnresolvedDependencyResult) {
            out.add(new RenderableUnresolvedDependencyResult((UnresolvedDependencyResult) d));
        } else {
            out.add(new RenderableDependencyResult((ResolvedDependencyResult) d));
        }
    }
    return out;
}
项目:Pushjet-Android    文件:CachingDependencyResultFactory.java   
public UnresolvedDependencyResult createUnresolvedDependency(ComponentSelector requested, ResolvedComponentResult from,
                                                   ComponentSelectionReason reason, ModuleVersionResolveException failure) {
    List<Object> key = asList(requested, from);
    if (!unresolvedDependencies.containsKey(key)) {
        unresolvedDependencies.put(key, new DefaultUnresolvedDependencyResult(requested, reason, from, failure));
    }
    return unresolvedDependencies.get(key);
}
项目:Reer    文件:RenderableUnresolvedDependencyResult.java   
public RenderableUnresolvedDependencyResult(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
}
项目:Reer    文件:UnresolvedDependencyEdge.java   
public UnresolvedDependencyEdge(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
    // TODO:Prezi Is this cast safe? Can't this be a LibraryComponentSelector, say?
    ModuleComponentSelector attempted = (ModuleComponentSelector)dependency.getAttempted();
    actual = DefaultModuleComponentIdentifier.newId(attempted.getGroup(), attempted.getModule(), attempted.getVersion());
}
项目:Pushjet-Android    文件:RenderableUnresolvedDependencyResult.java   
public RenderableUnresolvedDependencyResult(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
}
项目:Pushjet-Android    文件:UnresolvedDependencyEdge.java   
public UnresolvedDependencyEdge(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
    ModuleComponentSelector attempted = (ModuleComponentSelector)dependency.getAttempted();
    actual = DefaultModuleComponentIdentifier.newId(attempted.getGroup(), attempted.getModule(), attempted.getVersion());
}
项目:Pushjet-Android    文件:RenderableUnresolvedDependencyResult.java   
public RenderableUnresolvedDependencyResult(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
}
项目:Pushjet-Android    文件:UnresolvedDependencyEdge.java   
public UnresolvedDependencyEdge(UnresolvedDependencyResult dependency) {
    this.dependency = dependency;
    ModuleComponentSelector attempted = (ModuleComponentSelector)dependency.getAttempted();
    actual = DefaultModuleComponentIdentifier.newId(attempted.getGroup(), attempted.getModule(), attempted.getVersion());
}