use of com.blackducksoftware.integration.hub.detect.lifecycle.shutdown.ExitCodeRequest in project hub-detect by blackducksoftware.
the class ToolRunner method publishExtractionResults.
private void publishExtractionResults(final EventSystem eventSystem, final RunResult runResult, final Extraction extractionResult) {
runResult.addToolNameVersionIfPresent(toolDetector.getToolEnum(), Optional.of(new NameVersion(extractionResult.projectName, extractionResult.projectVersion)));
Optional<Object> dockerTar = extractionResult.getMetaDataValue(DockerExtractor.DOCKER_TAR_META_DATA_KEY);
if (dockerTar.isPresent()) {
runResult.addDockerFile(Optional.of((File) dockerTar.get()));
}
runResult.addDetectCodeLocations(extractionResult.codeLocations);
if (extractionResult.result == Extraction.ExtractionResultType.SUCCESS) {
eventSystem.publishEvent(Event.StatusSummary, new Status(toolDetector.getToolEnum().toString(), StatusType.SUCCESS));
} else {
eventSystem.publishEvent(Event.StatusSummary, new Status(toolDetector.getToolEnum().toString(), StatusType.FAILURE));
eventSystem.publishEvent(Event.ExitCode, new ExitCodeRequest(ExitCodeType.FAILURE_GENERAL_ERROR, extractionResult.description));
}
}
use of com.blackducksoftware.integration.hub.detect.lifecycle.shutdown.ExitCodeRequest in project hub-detect by blackducksoftware.
the class ToolRunner method publishNotExtractableResults.
private void publishNotExtractableResults(final EventSystem eventSystem, final DetectorResult extractableResult, final String toolName) {
logger.error(String.format("%s was not extractable: %s", toolName, extractableResult.toDescription()));
eventSystem.publishEvent(Event.StatusSummary, new Status(DetectTool.BAZEL.toString(), StatusType.FAILURE));
eventSystem.publishEvent(Event.ExitCode, new ExitCodeRequest(ExitCodeType.FAILURE_GENERAL_ERROR, extractableResult.toDescription()));
}
Aggregations