use of com.synopsys.integration.detectable.detectable.codelocation.CodeLocation in project synopsys-detect by blackducksoftware.
the class BazelExtractor method extract.
public Extraction extract(ExecutableTarget bazelExe, File workspaceDir, File workspaceFile) throws ExecutableFailedException, DetectableException {
toolVersionLogger.log(workspaceDir, bazelExe, "version");
BazelCommandExecutor bazelCommandExecutor = new BazelCommandExecutor(executableRunner, workspaceDir, bazelExe);
Pipelines pipelines = new Pipelines(bazelCommandExecutor, bazelVariableSubstitutor, externalIdFactory, haskellCabalLibraryJsonProtoParser);
Set<WorkspaceRule> workspaceRulesFromFile = parseWorkspaceRulesFromFile(workspaceFile);
Set<WorkspaceRule> workspaceRulesToQuery = workspaceRuleChooser.choose(workspaceRulesFromFile, workspaceRulesFromProperty);
CodeLocation codeLocation = generateCodelocation(pipelines, workspaceRulesToQuery);
return buildResults(codeLocation, bazelProjectNameGenerator.generateFromBazelTarget(bazelTarget));
}
use of com.synopsys.integration.detectable.detectable.codelocation.CodeLocation in project synopsys-detect by blackducksoftware.
the class ClangPackageDetailsTransformer method toCodeLocation.
public CodeLocation toCodeLocation(List<Forge> dependencyForges, Set<PackageDetails> packages) {
List<Dependency> dependencies = packages.parallelStream().flatMap(pkg -> toDependency(dependencyForges, pkg).stream()).collect(Collectors.toList());
logger.trace("Generated : {} dependencies.", dependencies.size());
DependencyGraph dependencyGraph = new BasicDependencyGraph();
dependencyGraph.addChildrenToRoot(dependencies);
return new CodeLocation(dependencyGraph);
}
use of com.synopsys.integration.detectable.detectable.codelocation.CodeLocation in project synopsys-detect by blackducksoftware.
the class GradleReportParserFunctionalTest method testUnresolvedConfigurations.
@Test
void testUnresolvedConfigurations() {
Optional<CodeLocation> codeLocation = buildCodeLocation("/gradle/gradle_implementations_dependencyGraph.txt", false);
Assertions.assertTrue(codeLocation.isPresent());
DependencyGraph dependencyGraph = codeLocation.get().getDependencyGraph();
GraphAssert graphAssert = new GraphAssert(Forge.MAVEN, dependencyGraph);
graphAssert.hasRootSize(0);
System.out.println(new GsonBuilder().setPrettyPrinting().create().toJson(codeLocation.get()));
}
use of com.synopsys.integration.detectable.detectable.codelocation.CodeLocation in project synopsys-detect by blackducksoftware.
the class GradleReportParserFunctionalTest method testImplementationsGraph.
@Test
void testImplementationsGraph() {
Optional<CodeLocation> codeLocation = buildCodeLocation("/gradle/gradle_implementations_dependencyGraph.txt", true);
Assertions.assertTrue(codeLocation.isPresent());
DependencyGraph dependencyGraph = codeLocation.get().getDependencyGraph();
GraphAssert graphAssert = new GraphAssert(Forge.MAVEN, dependencyGraph);
graphAssert.hasRootSize(7);
System.out.println(new GsonBuilder().setPrettyPrinting().create().toJson(codeLocation.get()));
}
use of com.synopsys.integration.detectable.detectable.codelocation.CodeLocation in project synopsys-detect by blackducksoftware.
the class LernaExternalDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(3, extraction.getCodeLocations().size(), "Expected one code location from root, and two from a non-private packages.");
CodeLocation codeLocationA = extraction.getCodeLocations().get(1);
Assertions.assertEquals("packageA", codeLocationA.getExternalId().map(ExternalId::getName).orElse(null), "Package A should be the second code location.");
NameVersionGraphAssert rootGraphAssert = new NameVersionGraphAssert(Forge.NPMJS, codeLocationA.getDependencyGraph());
rootGraphAssert.hasDependency("packageB", "3.2.1");
}
Aggregations