use of com.synopsys.integration.detect.lifecycle.boot.DetectBoot in project synopsys-detect by blackducksoftware.
the class Application method bootApplication.
private Optional<DetectBootResult> bootApplication(DetectRunId detectRunId, String[] sourceArgs, EventSystem eventSystem, ExitCodeManager exitCodeManager, Gson gson, DetectInfo detectInfo, FileFinder fileFinder, InstalledToolManager installedToolManager, ExceptionUtility exceptionUtility) {
Optional<DetectBootResult> bootResult = Optional.empty();
try {
logger.debug("Detect boot begin.");
DetectArgumentStateParser detectArgumentStateParser = new DetectArgumentStateParser();
DetectArgumentState detectArgumentState = detectArgumentStateParser.parseArgs(sourceArgs);
List<PropertySource> propertySources = new ArrayList<>(SpringConfigurationPropertySource.fromConfigurableEnvironmentSafely(environment, logger::error));
DetectBootFactory detectBootFactory = new DetectBootFactory(detectRunId, detectInfo, gson, eventSystem, fileFinder);
DetectBoot detectBoot = new DetectBoot(eventSystem, gson, detectBootFactory, detectArgumentState, propertySources, installedToolManager);
bootResult = detectBoot.boot(detectInfo.getDetectVersion(), detectInfo.getBuildDateString());
logger.debug("Detect boot completed.");
} catch (Exception e) {
logger.error("Detect boot failed.");
logger.error("");
exceptionUtility.logException(e);
exitCodeManager.requestExitCode(e);
logger.error("");
// TODO- should we return a DetectBootResult.exception(...) here?
}
return bootResult;
}
Aggregations