Search in sources :

Example 1 with FoundExecutable

use of com.synopsys.integration.detectable.detectable.explanation.FoundExecutable 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 FoundExecutable

use of com.synopsys.integration.detectable.detectable.explanation.FoundExecutable in project synopsys-detect by blackducksoftware.

the class GitDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    try {
        gitExecutable = gitResolver.resolveGit();
    } catch (DetectableException e) {
        gitExecutable = null;
    }
    if (gitExecutable != null) {
        return new PassedDetectableResult(new FoundExecutable(gitExecutable));
    } else {
        // Couldn't find git executable, so we try to parse git files
        gitConfigFile = fileFinder.findFile(gitDirectory, GIT_CONFIG_FILENAME);
        gitHeadFile = fileFinder.findFile(gitDirectory, GIT_HEAD_FILENAME);
        if ((gitConfigFile != null && gitHeadFile != null)) {
            canParse = true;
            return new PassedDetectableResult(Arrays.asList(new FoundFile(gitConfigFile), new FoundFile(gitHeadFile)));
        }
    }
    return new PassedDetectableResult();
}
Also used : FoundExecutable(com.synopsys.integration.detectable.detectable.explanation.FoundExecutable) FoundFile(com.synopsys.integration.detectable.detectable.explanation.FoundFile) PassedDetectableResult(com.synopsys.integration.detectable.detectable.result.PassedDetectableResult) DetectableException(com.synopsys.integration.detectable.detectable.exception.DetectableException)

Example 3 with FoundExecutable

use of com.synopsys.integration.detectable.detectable.explanation.FoundExecutable in project synopsys-detect by blackducksoftware.

the class SbtDetectable method sbtPluginExtractable.

// Check if SBT & a plugin can be found
private DetectableResult sbtPluginExtractable() throws DetectableException {
    List<Explanation> explanations = new ArrayList<>();
    sbt = sbtResolver.resolveSbt();
    if (sbt == null) {
        return new ExecutableNotFoundDetectableResult("sbt");
    } else {
        explanations.add(new FoundExecutable(sbt));
    }
    foundPlugin = sbtPluginFinder.isPluginInstalled(environment.getDirectory(), sbt, sbtResolutionCacheOptions.getSbtCommandAdditionalArguments());
    if (!foundPlugin) {
        return new SbtMissingPluginDetectableResult(environment.getDirectory().toString());
    } else {
        explanations.add(new FoundSbtPlugin("Dependency Graph"));
    }
    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) SbtMissingPluginDetectableResult(com.synopsys.integration.detectable.detectable.result.SbtMissingPluginDetectableResult) ArrayList(java.util.ArrayList) FoundSbtPlugin(com.synopsys.integration.detectable.detectable.explanation.FoundSbtPlugin) PassedDetectableResult(com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)

Aggregations

FoundExecutable (com.synopsys.integration.detectable.detectable.explanation.FoundExecutable)3 PassedDetectableResult (com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)3 Explanation (com.synopsys.integration.detectable.detectable.explanation.Explanation)2 ExecutableNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundDetectableResult)2 ArrayList (java.util.ArrayList)2 DetectableException (com.synopsys.integration.detectable.detectable.exception.DetectableException)1 FoundFile (com.synopsys.integration.detectable.detectable.explanation.FoundFile)1 FoundInspector (com.synopsys.integration.detectable.detectable.explanation.FoundInspector)1 FoundSbtPlugin (com.synopsys.integration.detectable.detectable.explanation.FoundSbtPlugin)1 InspectorNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult)1 SbtMissingPluginDetectableResult (com.synopsys.integration.detectable.detectable.result.SbtMissingPluginDetectableResult)1