Search in sources :

Example 1 with DependencyGraphEdge

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);
        }
    }
}
Also used : ModuleDependency(org.gradle.api.artifacts.ModuleDependency) DependencyGraphEdge(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge)

Example 2 with DependencyGraphEdge

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());
                }
            }
        });
    }
}
Also used : DependencyGraphEdge(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge)

Example 3 with DependencyGraphEdge

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));
    }
}
Also used : DependencyGraphNode(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphNode) DependencyGraphEdge(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge) LocalFileDependencyMetadata(org.gradle.internal.component.local.model.LocalFileDependencyMetadata)

Example 4 with DependencyGraphEdge

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);
    }
}
Also used : DependencyGraphNode(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphNode) DependencyGraphEdge(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge)

Aggregations

DependencyGraphEdge (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphEdge)4 DependencyGraphNode (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphNode)2 ModuleDependency (org.gradle.api.artifacts.ModuleDependency)1 LocalFileDependencyMetadata (org.gradle.internal.component.local.model.LocalFileDependencyMetadata)1