Search in sources :

Example 1 with NugetPackageId

use of com.synopsys.integration.detectable.detectables.nuget.model.NugetPackageId in project synopsys-detect by blackducksoftware.

the class NugetDependencyNodeBuilder method createDependencyGraph.

public DependencyGraph createDependencyGraph(List<NugetPackageId> packageDependencies) {
    DependencyGraph graph = new BasicDependencyGraph();
    for (NugetPackageSet packageSet : packageSets) {
        if (packageSet.dependencies != null) {
            for (NugetPackageId id : packageSet.dependencies) {
                if (packageSet.packageId != null) {
                    graph.addParentWithChild(convertPackageId(packageSet.packageId), convertPackageId(id));
                }
            }
        }
    }
    packageDependencies.stream().map(this::convertPackageId).forEach(graph::addChildToRoot);
    return graph;
}
Also used : DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) BasicDependencyGraph(com.synopsys.integration.bdio.graph.BasicDependencyGraph) BasicDependencyGraph(com.synopsys.integration.bdio.graph.BasicDependencyGraph) NugetPackageSet(com.synopsys.integration.detectable.detectables.nuget.model.NugetPackageSet) NugetPackageId(com.synopsys.integration.detectable.detectables.nuget.model.NugetPackageId)

Aggregations

BasicDependencyGraph (com.synopsys.integration.bdio.graph.BasicDependencyGraph)1 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 NugetPackageId (com.synopsys.integration.detectable.detectables.nuget.model.NugetPackageId)1 NugetPackageSet (com.synopsys.integration.detectable.detectables.nuget.model.NugetPackageSet)1