Search in sources :

Example 1 with InspectorNotFoundDetectableResult

use of com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult in project synopsys-detect by blackducksoftware.

the class GradleDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    List<Explanation> explanations = new ArrayList<>();
    gradleExe = gradleResolver.resolveGradle(environment);
    if (gradleExe == null) {
        return new ExecutableNotFoundDetectableResult("gradle");
    } else {
        explanations.add(new FoundExecutable(gradleExe));
    }
    gradleInspector = gradleInspectorResolver.resolveGradleInspector();
    if (gradleInspector == null) {
        return new InspectorNotFoundDetectableResult("gradle");
    } else {
        explanations.add(new FoundInspector(gradleInspector));
    }
    return new PassedDetectableResult(explanations);
}
Also used : ExecutableNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundDetectableResult) FoundExecutable(com.synopsys.integration.detectable.detectable.explanation.FoundExecutable) Explanation(com.synopsys.integration.detectable.detectable.explanation.Explanation) ArrayList(java.util.ArrayList) FoundInspector(com.synopsys.integration.detectable.detectable.explanation.FoundInspector) PassedDetectableResult(com.synopsys.integration.detectable.detectable.result.PassedDetectableResult) InspectorNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult)

Example 2 with InspectorNotFoundDetectableResult

use of com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult in project synopsys-detect by blackducksoftware.

the class DockerDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    // TODO: Can this be improved with a Requirements object? - jp
    PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
    javaExe = javaResolver.resolveJava();
    if (javaExe == null) {
        return new ExecutableNotFoundDetectableResult("java");
    } else {
        passedResultBuilder.foundExecutable(javaExe);
    }
    try {
        dockerExe = dockerResolver.resolveDocker();
    } catch (Exception e) {
        dockerExe = null;
    }
    if (dockerExe == null) {
        if (dockerDetectableOptions.isDockerPathRequired()) {
            return new ExecutableNotFoundDetectableResult("docker");
        } else {
            logger.debug("Docker executable not found, but it has been configured as not-required; proceeding with execution of Docker tool. Running in air-gap mode will not work without a Docker executable.");
        }
    } else {
        passedResultBuilder.foundExecutable(dockerExe);
    }
    dockerInspectorInfo = dockerInspectorResolver.resolveDockerInspector();
    if (dockerInspectorInfo == null) {
        return new InspectorNotFoundDetectableResult("docker");
    } else {
        passedResultBuilder.foundInspector(dockerInspectorInfo.getDockerInspectorJar());
    }
    return passedResultBuilder.build();
}
Also used : ExecutableNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundDetectableResult) PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) IOException(java.io.IOException) ExecutableRunnerException(com.synopsys.integration.executable.ExecutableRunnerException) DetectableException(com.synopsys.integration.detectable.detectable.exception.DetectableException) InspectorNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult)

Aggregations

ExecutableNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundDetectableResult)2 InspectorNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult)2 PassedResultBuilder (com.synopsys.integration.detectable.detectable.PassedResultBuilder)1 DetectableException (com.synopsys.integration.detectable.detectable.exception.DetectableException)1 Explanation (com.synopsys.integration.detectable.detectable.explanation.Explanation)1 FoundExecutable (com.synopsys.integration.detectable.detectable.explanation.FoundExecutable)1 FoundInspector (com.synopsys.integration.detectable.detectable.explanation.FoundInspector)1 PassedDetectableResult (com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)1 ExecutableRunnerException (com.synopsys.integration.executable.ExecutableRunnerException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1