use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge in project gradle by gradle.
the class ResolvedConfigurationDependencyGraphVisitor method visitEdges.
public void visitEdges(DependencyGraphNode resolvedConfiguration) {
for (DependencyGraphEdge dependency : resolvedConfiguration.getIncomingEdges()) {
if (dependency.getFrom() == root) {
ModuleDependency moduleDependency = dependency.getModuleDependency();
builder.addFirstLevelDependency(moduleDependency, resolvedConfiguration);
}
}
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge in project gradle by gradle.
the class StreamingResolutionResultBuilder method visitEdges.
@Override
public void visitEdges(DependencyGraphNode node) {
final Long fromComponent = node.getOwner().getResultId();
final Collection<? extends DependencyGraphEdge> dependencies = mayHaveVirtualPlatforms ? node.getOutgoingEdges().stream().filter(dep -> !dep.isTargetVirtualPlatform()).collect(Collectors.toList()) : node.getOutgoingEdges();
if (!dependencies.isEmpty()) {
store.write(encoder -> {
encoder.writeByte(DEPENDENCY);
encoder.writeSmallLong(fromComponent);
encoder.writeSmallInt(dependencies.size());
for (DependencyGraphEdge dependency : dependencies) {
dependencyResultSerializer.write(encoder, dependency);
if (dependency.getFailure() != null) {
// by keying the failures only by 'requested' we lose some precision
// at edge case we'll lose info about a different exception if we have different failure for the same requested version
failures.put(dependency.getRequested(), dependency.getFailure());
}
}
});
}
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge in project gradle by gradle.
the class ResolvedArtifactsGraphVisitor method visitEdges.
@Override
public void visitEdges(DependencyGraphNode node) {
for (DependencyGraphEdge dependency : node.getIncomingEdges()) {
if (dependency.contributesArtifacts()) {
DependencyGraphNode parent = dependency.getFrom();
ArtifactsForNode artifacts = getArtifacts(dependency, node);
artifactResults.visitArtifacts(parent, node, artifacts.artifactSetId, artifacts.artifactSet);
}
}
for (LocalFileDependencyMetadata fileDependency : node.getOutgoingFileEdges()) {
int id = nextId++;
artifactResults.visitArtifacts(node, fileDependency, id, artifactSelector.resolveArtifacts(fileDependency));
}
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge in project gradle by gradle.
the class DefaultResolvedArtifactsBuilder method topologicalSort.
private void topologicalSort(DependencyGraphNode node, Set<DependencyGraphNode> tempMarked, List<DependencyGraphNode> marked) {
if (tempMarked.contains(node)) {
return;
}
if (!marked.contains(node)) {
tempMarked.add(node);
List<DependencyGraphEdge> edges = Lists.newArrayList(node.getOutgoingEdges());
for (DependencyGraphEdge dependencyEdge : Lists.reverse(edges)) {
for (DependencyGraphNode targetConfiguration : dependencyEdge.getTargets()) {
topologicalSort(targetConfiguration, tempMarked, marked);
}
}
marked.add(node);
tempMarked.remove(node);
}
}
Aggregations