use of com.synopsys.integration.detectable.detectables.conan.cli.parser.ConanInfoNodeParser in project synopsys-detect by blackducksoftware.
the class DetectableFactory method conanCliExtractor.
private ConanCliExtractor conanCliExtractor(ConanCliOptions options) {
ConanCommandRunner conanCommandRunner = new ConanCommandRunner(executableRunner, options.getLockfilePath().orElse(null), options.getAdditionalArguments().orElse(null));
ConanInfoLineAnalyzer conanInfoLineAnalyzer = new ConanInfoLineAnalyzer();
ConanCodeLocationGenerator conanCodeLocationGenerator = new ConanCodeLocationGenerator(options.getDependencyTypeFilter(), options.preferLongFormExternalIds());
NodeElementParser nodeElementParser = new NodeElementParser(conanInfoLineAnalyzer);
ConanInfoNodeParser conanInfoNodeParser = new ConanInfoNodeParser(conanInfoLineAnalyzer, nodeElementParser);
ConanInfoParser conanInfoParser = new ConanInfoParser(conanInfoNodeParser, conanCodeLocationGenerator, externalIdFactory);
return new ConanCliExtractor(conanCommandRunner, conanInfoParser, toolVersionLogger);
}
use of com.synopsys.integration.detectable.detectables.conan.cli.parser.ConanInfoNodeParser in project synopsys-detect by blackducksoftware.
the class ConanCliParserFunctionalTest method test.
@Test
public void test() throws IOException, IntegrationException {
File conanInfoOutputFile = FunctionalTestFiles.asFile("/conan/cli/conan_info.txt");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanCodeLocationGenerator conanCodeLocationGenerator = new ConanCodeLocationGenerator(dependencyTypeFilter, false);
ConanInfoLineAnalyzer conanInfoLineAnalyzer = new ConanInfoLineAnalyzer();
NodeElementParser nodeElementParser = new NodeElementParser(conanInfoLineAnalyzer);
ConanInfoNodeParser conanInfoNodeParser = new ConanInfoNodeParser(conanInfoLineAnalyzer, nodeElementParser);
ConanInfoParser parser = new ConanInfoParser(conanInfoNodeParser, conanCodeLocationGenerator, new ExternalIdFactory());
String conanInfoOutput = FileUtils.readFileToString(conanInfoOutputFile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanInfoOutput(conanInfoOutput);
assertEquals(3, result.getCodeLocation().getDependencyGraph().getRootDependencies().size());
DependencyGraph actualDependencyGraph = result.getCodeLocation().getDependencyGraph();
GraphCompare.assertEqualsResource("/conan/cli/noProjectRef_graph.json", actualDependencyGraph);
}
Aggregations