/** * 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; }
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); }
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; }
@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; }
@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; }
/** * 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; }
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; }
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; }
public RenderableUnresolvedDependencyResult(UnresolvedDependencyResult dependency) { this.dependency = dependency; }
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()); }
public UnresolvedDependencyEdge(UnresolvedDependencyResult dependency) { this.dependency = dependency; ModuleComponentSelector attempted = (ModuleComponentSelector)dependency.getAttempted(); actual = DefaultModuleComponentIdentifier.newId(attempted.getGroup(), attempted.getModule(), attempted.getVersion()); }