Search in sources :

Example 1 with ReportDetectResult

use of com.synopsys.integration.detect.workflow.result.ReportDetectResult in project synopsys-detect by blackducksoftware.

the class DetectStatusLoggerTest method createResults.

private List<DetectResult> createResults() {
    ArrayList<DetectResult> detectResults = new ArrayList<>();
    DetectResult result = new BlackDuckBomDetectResult("https://example.com/api/projects/project_1");
    detectResults.add(result);
    result = new BlackDuckBomDetectResult("https://example.com/api/projects/project_2");
    detectResults.add(result);
    result = new AirGapDetectResult("./air_gap/directory");
    detectResults.add(result);
    result = new ReportDetectResult("report_1", "./report/1/report_file");
    detectResults.add(result);
    return detectResults;
}
Also used : AirGapDetectResult(com.synopsys.integration.detect.workflow.result.AirGapDetectResult) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) ArrayList(java.util.ArrayList) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult) AirGapDetectResult(com.synopsys.integration.detect.workflow.result.AirGapDetectResult) DetectResult(com.synopsys.integration.detect.workflow.result.DetectResult) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult)

Example 2 with ReportDetectResult

use of com.synopsys.integration.detect.workflow.result.ReportDetectResult in project synopsys-detect by blackducksoftware.

the class IntelligentModeStepRunner method riskReport.

public void riskReport(BlackDuckRunData blackDuckRunData, ProjectVersionWrapper projectVersion) throws IOException, OperationException {
    Optional<File> riskReportFile = operationFactory.calculateRiskReportFileLocation();
    if (riskReportFile.isPresent()) {
        logger.info("Creating risk report pdf");
        File reportDirectory = riskReportFile.get();
        if (!reportDirectory.exists() && !reportDirectory.mkdirs()) {
            logger.warn(String.format("Failed to create risk report pdf directory: %s", reportDirectory));
        }
        File createdPdf = operationFactory.createRiskReportFile(blackDuckRunData, projectVersion, reportDirectory);
        logger.info(String.format("Created risk report pdf: %s", createdPdf.getCanonicalPath()));
        operationFactory.publishReport(new ReportDetectResult("Risk Report", createdPdf.getCanonicalPath()));
    }
}
Also used : ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) File(java.io.File)

Example 3 with ReportDetectResult

use of com.synopsys.integration.detect.workflow.result.ReportDetectResult in project synopsys-detect by blackducksoftware.

the class IntelligentModeStepRunner method noticesReport.

public void noticesReport(BlackDuckRunData blackDuckRunData, ProjectVersionWrapper projectVersion) throws OperationException, IOException {
    Optional<File> noticesReportDirectory = operationFactory.calculateNoticesDirectory();
    if (noticesReportDirectory.isPresent()) {
        logger.info("Creating notices report");
        File noticesDirectory = noticesReportDirectory.get();
        if (!noticesDirectory.exists() && !noticesDirectory.mkdirs()) {
            logger.warn(String.format("Failed to create notices directory at %s", noticesDirectory));
        }
        File noticesFile = operationFactory.createNoticesReportFile(blackDuckRunData, projectVersion, noticesDirectory);
        logger.info(String.format("Created notices report: %s", noticesFile.getCanonicalPath()));
        operationFactory.publishReport(new ReportDetectResult("Notices Report", noticesFile.getCanonicalPath()));
    }
}
Also used : ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) File(java.io.File)

Aggregations

ReportDetectResult (com.synopsys.integration.detect.workflow.result.ReportDetectResult)3 File (java.io.File)2 AirGapDetectResult (com.synopsys.integration.detect.workflow.result.AirGapDetectResult)1 BlackDuckBomDetectResult (com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult)1 DetectResult (com.synopsys.integration.detect.workflow.result.DetectResult)1 ArrayList (java.util.ArrayList)1