Search in sources :

Example 1 with BdioCodeLocation

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;
}
Also used : BdioCodeLocation(com.blackducksoftware.integration.hub.detect.workflow.codelocation.BdioCodeLocation) UploadTarget(com.synopsys.integration.blackduck.codelocation.bdioupload.UploadTarget) ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) ArrayList(java.util.ArrayList) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) File(java.io.File) SimpleBdioDocument(com.synopsys.integration.bdio.model.SimpleBdioDocument)

Aggregations

BdioCodeLocation (com.blackducksoftware.integration.hub.detect.workflow.codelocation.BdioCodeLocation)1 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 SimpleBdioDocument (com.synopsys.integration.bdio.model.SimpleBdioDocument)1 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)1 UploadTarget (com.synopsys.integration.blackduck.codelocation.bdioupload.UploadTarget)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1