use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.model.Target in project synopsys-detect by blackducksoftware.
the class HaskellCabalLibraryJsonProtoParser method extractAddDependencies.
private void extractAddDependencies(String jsonProtoString, List<NameVersion> dependencies, ResultItem result) throws DetectableException {
if (result == null || result.getTarget() == null) {
throw new DetectableException(String.format("Unable to parse target from result inJSON proto string: %s", jsonProtoString));
}
Target target = result.getTarget();
if ("RULE".equals(target.getType())) {
if (target.getRule() == null || target.getRule().getAttribute() == null) {
throw new DetectableException(String.format("Unable to parse attributes from rule inJSON proto string: %s", jsonProtoString));
}
List<AttributeItem> attributes = target.getRule().getAttribute();
NameVersion dependency = extractDependency(attributes);
logger.debug("Adding dependency {}/{}}", dependency.getName(), dependency.getVersion());
dependencies.add(dependency);
}
}
Aggregations