use of com.synopsys.integration.detectable.detectables.gradle.inspection.model.GradleConfiguration in project synopsys-detect by blackducksoftware.
the class GradleReportParser method parseConfigurationLines.
private void parseConfigurationLines(List<String> configurationLines, GradleReport gradleReport) {
if (configurationLines.size() > 1 && isConfigurationHeader(configurationLines)) {
String header = configurationLines.get(0);
List<String> dependencyTree = configurationLines.stream().skip(1).collect(Collectors.toList());
GradleConfiguration configuration = gradleReportConfigurationParser.parse(header, dependencyTree);
gradleReport.getConfigurations().add(configuration);
}
}
use of com.synopsys.integration.detectable.detectables.gradle.inspection.model.GradleConfiguration in project synopsys-detect by blackducksoftware.
the class GradleReportTransformer method transform.
public CodeLocation transform(GradleReport gradleReport) {
DependencyGraph graph = new BasicDependencyGraph();
for (GradleConfiguration configuration : gradleReport.getConfigurations()) {
if (configuration.isResolved() || configurationTypeFilter.shouldInclude(GradleConfigurationType.UNRESOLVED)) {
logger.trace("Adding configuration to the graph: {}", configuration.getName());
addConfigurationToGraph(graph, configuration);
} else {
logger.trace("Excluding unresolved configuration from the graph: {}", configuration.getName());
}
}
ExternalId projectId = ExternalId.FACTORY.createMavenExternalId(gradleReport.getProjectGroup(), gradleReport.getProjectName(), gradleReport.getProjectVersionName());
if (StringUtils.isNotBlank(gradleReport.getProjectSourcePath())) {
return new CodeLocation(graph, projectId, new File(gradleReport.getProjectSourcePath()));
} else {
return new CodeLocation(graph, projectId);
}
}
use of com.synopsys.integration.detectable.detectables.gradle.inspection.model.GradleConfiguration in project synopsys-detect by blackducksoftware.
the class GradleReportConfigurationParser method parse.
public GradleConfiguration parse(String header, List<String> dependencyLines) {
GradleConfiguration configuration = new GradleConfiguration();
configuration.setName(parseConfigurationName(header));
configuration.setUnresolved(parseUnresolved(header));
configuration.setChildren(dependencyLines.stream().map(parser::parseLine).collect(Collectors.toList()));
return configuration;
}
Aggregations