Search in sources :

Example 1 with NugetPackageId

use of com.blackducksoftware.integration.hub.detect.detector.nuget.model.NugetPackageId in project hub-detect by blackducksoftware.

the class NugetDependencyNodeBuilder method createDependencyGraph.

public DependencyGraph createDependencyGraph(final List<NugetPackageId> packageDependencies) {
    final MutableDependencyGraph graph = new MutableMapDependencyGraph();
    if (packageSets != null) {
        for (final NugetPackageSet packageSet : packageSets) {
            if (packageSet.dependencies != null) {
                for (final NugetPackageId id : packageSet.dependencies) {
                    if (packageSet.packageId != null) {
                        graph.addParentWithChild(convertPackageId(packageSet.packageId), convertPackageId(id));
                    }
                }
            }
        }
    }
    packageDependencies.forEach(it -> {
        graph.addChildToRoot(convertPackageId(it));
    });
    return graph;
}
Also used : MutableDependencyGraph(com.synopsys.integration.bdio.graph.MutableDependencyGraph) MutableMapDependencyGraph(com.synopsys.integration.bdio.graph.MutableMapDependencyGraph) NugetPackageSet(com.blackducksoftware.integration.hub.detect.detector.nuget.model.NugetPackageSet) NugetPackageId(com.blackducksoftware.integration.hub.detect.detector.nuget.model.NugetPackageId)

Aggregations

NugetPackageId (com.blackducksoftware.integration.hub.detect.detector.nuget.model.NugetPackageId)1 NugetPackageSet (com.blackducksoftware.integration.hub.detect.detector.nuget.model.NugetPackageSet)1 MutableDependencyGraph (com.synopsys.integration.bdio.graph.MutableDependencyGraph)1 MutableMapDependencyGraph (com.synopsys.integration.bdio.graph.MutableMapDependencyGraph)1