use of com.synopsys.integration.detectable.detectable.PassedResultBuilder 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();
}
use of com.synopsys.integration.detectable.detectable.PassedResultBuilder in project synopsys-detect by blackducksoftware.
the class ConanCliDetectable method applicable.
@Override
public DetectableResult applicable() {
PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
File conanTxtFile = fileFinder.findFile(environment.getDirectory(), CONANFILETXT);
if (conanTxtFile == null) {
File conanPyFile = fileFinder.findFile(environment.getDirectory(), CONANFILEPY);
if (conanPyFile == null) {
return new FileNotFoundDetectableResult(CONANFILETXT);
} else {
passedResultBuilder.foundFile(conanPyFile);
}
} else {
passedResultBuilder.foundFile(conanTxtFile);
}
return passedResultBuilder.build();
}
Aggregations