use of com.synopsys.integration.detectable.detectable.explanation.FoundFile in project synopsys-detect by blackducksoftware.
the class Requirements method explainFile.
public void explainFile(@NotNull File file) {
relevantFiles.add(file);
explanations.add(new FoundFile(file));
}
use of com.synopsys.integration.detectable.detectable.explanation.FoundFile in project synopsys-detect by blackducksoftware.
the class GradleDetectable method applicable.
@Override
public DetectableResult applicable() {
File buildGradle = fileFinder.findFile(environment.getDirectory(), BUILD_GRADLE_FILENAME);
if (buildGradle != null) {
return new PassedDetectableResult(new FoundFile(buildGradle));
}
File kotlinBuildGradle = fileFinder.findFile(environment.getDirectory(), KOTLIN_BUILD_GRADLE_FILENAME);
if (kotlinBuildGradle != null) {
return new PassedDetectableResult(new FoundFile(kotlinBuildGradle));
}
return new FilesNotFoundDetectableResult(BUILD_GRADLE_FILENAME, KOTLIN_BUILD_GRADLE_FILENAME);
}
use of com.synopsys.integration.detectable.detectable.explanation.FoundFile 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();
}
use of com.synopsys.integration.detectable.detectable.explanation.FoundFile in project synopsys-detect by blackducksoftware.
the class ConanLockfileDetectable method applicable.
@Override
public DetectableResult applicable() {
if (conanLockfileExtractorOptions.getLockfilePath().isPresent()) {
Path conanLockFile = conanLockfileExtractorOptions.getLockfilePath().get();
logger.debug("Conan Lockfile detectable applies because user supplied lockfile path {}", conanLockFile);
// TODO: Should lock file be reported as a relevant file?
return new PassedDetectableResult(new FoundFile(conanLockFile.toFile()));
}
Requirements requirements = new Requirements(fileFinder, environment);
lockfile = requirements.file(CONANLOCKFILE);
return requirements.result();
}
use of com.synopsys.integration.detectable.detectable.explanation.FoundFile in project synopsys-detect by blackducksoftware.
the class PassedResultBuilder method foundFile.
public void foundFile(@NotNull File file) {
explanations.add(new FoundFile(file));
relevantFiles.add(file);
}
Aggregations