use of com.blackducksoftware.integration.hub.detect.workflow.codelocation.BdioCodeLocation in project hub-detect by blackducksoftware.
the class CodeLocationBdioCreator method createBdioFiles.
public List<UploadTarget> createBdioFiles(File bdioOutput, final List<BdioCodeLocation> bdioCodeLocations, NameVersion projectNameVersion) throws DetectUserFriendlyException {
final List<UploadTarget> uploadTargets = new ArrayList<>();
for (final BdioCodeLocation bdioCodeLocation : bdioCodeLocations) {
String codeLocationName = bdioCodeLocation.codeLocationName;
ExternalId externalId = bdioCodeLocation.codeLocation.getExternalId();
DependencyGraph dependencyGraph = bdioCodeLocation.codeLocation.getDependencyGraph();
final SimpleBdioDocument simpleBdioDocument = simpleBdioFactory.createSimpleBdioDocument(codeLocationName, projectNameVersion.getName(), projectNameVersion.getVersion(), externalId, dependencyGraph);
final File outputFile = new File(bdioOutput, bdioCodeLocation.bdioName);
detectBdioWriter.writeBdioFile(outputFile, simpleBdioDocument);
uploadTargets.add(UploadTarget.createDefault(codeLocationName, outputFile));
}
return uploadTargets;
}
Aggregations