use of com.synopsys.integration.detect.lifecycle.run.DetectRun in project synopsys-detect by blackducksoftware.
the class Application method runApplication.
private void runApplication(EventSystem eventSystem, ExitCodeManager exitCodeManager, DetectBootResult detectBootResult, ExceptionUtility exceptionUtility) {
Optional<BootSingletons> optionalRunContext = detectBootResult.getBootSingletons();
Optional<ProductRunData> optionalProductRunData = detectBootResult.getProductRunData();
if (detectBootResult.getBootType() == DetectBootResult.BootType.RUN && optionalProductRunData.isPresent() && optionalRunContext.isPresent()) {
logger.debug("Detect will attempt to run.");
DetectRun detectRun = new DetectRun(exitCodeManager, exceptionUtility);
detectRun.run(optionalRunContext.get());
} else {
logger.debug("Detect will NOT attempt to run.");
detectBootResult.getException().ifPresent(exitCodeManager::requestExitCode);
detectBootResult.getException().ifPresent(e -> DetectIssue.publish(eventSystem, DetectIssueType.EXCEPTION, "Detect Boot Error", e.getMessage()));
}
}
Aggregations