use of com.synopsys.integration.detectable.detectables.conan.cli.config.ConanDependencyType in project synopsys-detect by blackducksoftware.
the class ConanLockfileParserFunctionalTest method testRelativePath.
@Test
public void testRelativePath() throws IOException, IntegrationException {
File lockfile = FunctionalTestFiles.asFile("/conan/lockfile/conan_relpath.lock");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanLockfileParser parser = new ConanLockfileParser(new Gson(), new ConanCodeLocationGenerator(dependencyTypeFilter, true), new ExternalIdFactory());
String conanLockfileContents = FileUtils.readFileToString(lockfile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanLockfileContents(conanLockfileContents);
assertEquals(1, result.getCodeLocation().getDependencyGraph().getRootDependencies().size());
}
use of com.synopsys.integration.detectable.detectables.conan.cli.config.ConanDependencyType in project synopsys-detect by blackducksoftware.
the class DetectableOptionFactory method createConanLockfileOptions.
public ConanLockfileExtractorOptions createConanLockfileOptions() {
Path lockfilePath = detectConfiguration.getPathOrNull(DetectProperties.DETECT_CONAN_LOCKFILE_PATH);
Boolean preferLongFormExternalIds = detectConfiguration.getValue(DetectProperties.DETECT_CONAN_REQUIRE_PREV_MATCH);
EnumListFilter<ConanDependencyType> dependencyTypeFilter = createConanDependencyTypeFilter();
return new ConanLockfileExtractorOptions(lockfilePath, dependencyTypeFilter, preferLongFormExternalIds);
}
use of com.synopsys.integration.detectable.detectables.conan.cli.config.ConanDependencyType in project synopsys-detect by blackducksoftware.
the class DetectableOptionFactory method createConanCliOptions.
public ConanCliOptions createConanCliOptions() {
Path lockfilePath = detectConfiguration.getPathOrNull(DetectProperties.DETECT_CONAN_LOCKFILE_PATH);
String additionalArguments = detectConfiguration.getNullableValue(DetectProperties.DETECT_CONAN_ARGUMENTS);
Boolean preferLongFormExternalIds = detectConfiguration.getValue(DetectProperties.DETECT_CONAN_REQUIRE_PREV_MATCH);
EnumListFilter<ConanDependencyType> dependencyTypeFilter = createConanDependencyTypeFilter();
return new ConanCliOptions(lockfilePath, additionalArguments, dependencyTypeFilter, preferLongFormExternalIds);
}
use of com.synopsys.integration.detectable.detectables.conan.cli.config.ConanDependencyType 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);
}
use of com.synopsys.integration.detectable.detectables.conan.cli.config.ConanDependencyType in project synopsys-detect by blackducksoftware.
the class ConanLockfileParserFunctionalTest method testNoProjectRef.
@Test
public void testNoProjectRef() throws IOException, IntegrationException {
File lockfile = FunctionalTestFiles.asFile("/conan/lockfile/conan.lock");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanLockfileParser parser = new ConanLockfileParser(new Gson(), new ConanCodeLocationGenerator(dependencyTypeFilter, false), new ExternalIdFactory());
String conanLockfileContents = FileUtils.readFileToString(lockfile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanLockfileContents(conanLockfileContents);
assertEquals(3, result.getCodeLocation().getDependencyGraph().getRootDependencies().size());
DependencyGraph actualDependencyGraph = result.getCodeLocation().getDependencyGraph();
GraphCompare.assertEqualsResource("/conan/lockfile/noProjectRef_graph.json", actualDependencyGraph);
}
Aggregations