Search in sources :

Example 11 with Requirements

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

the class LernaDetectable method applicable.

@Override
public DetectableResult applicable() {
    Requirements requirements = new Requirements(fileFinder, environment);
    requirements.file(LERNA_JSON);
    return requirements.result();
}
Also used : Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Example 12 with Requirements

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

the class LernaDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    Requirements requirements = new Requirements(fileFinder, environment);
    // Lerna is used in conjunction with traditional NPM projects or Yarn projects.
    File packageLockFile = fileFinder.findFile(environment.getDirectory(), PACKAGE_LOCK_JSON);
    File shrinkwrapFile = fileFinder.findFile(environment.getDirectory(), SHRINKWRAP_JSON);
    File yarnLockFile = fileFinder.findFile(environment.getDirectory(), YARN_LOCK);
    if (packageLockFile == null && shrinkwrapFile == null && yarnLockFile == null) {
        return new FilesNotFoundDetectableResult(PACKAGE_LOCK_JSON, YARN_LOCK);
    }
    requirements.explainNullableFile(packageLockFile);
    requirements.explainNullableFile(shrinkwrapFile);
    requirements.explainNullableFile(yarnLockFile);
    packageJson = requirements.file(PACKAGE_JSON);
    lernaExecutable = requirements.executable(lernaResolver::resolveLerna, "lerna");
    return requirements.result();
}
Also used : FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult) File(java.io.File) Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Example 13 with Requirements

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

the class MavenPomDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    Requirements requirements = new Requirements(fileFinder, environment);
    mavenExe = requirements.executable(() -> mavenResolver.resolveMaven(environment), "maven");
    return requirements.result();
}
Also used : Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Example 14 with Requirements

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

the class MavenParseDetectable method applicable.

@Override
public DetectableResult applicable() {
    if (mavenParseOptions.isEnableLegacyMode()) {
        Requirements requirements = new Requirements(fileFinder, environment);
        pomXmlFile = requirements.file(POM_XML_FILENAME);
        return requirements.result();
    } else {
        return new PropertyInsufficientDetectableResult("Maven legacy buildless parse must be enabled.");
    }
}
Also used : Requirements(com.synopsys.integration.detectable.detectable.Requirements) PropertyInsufficientDetectableResult(com.synopsys.integration.detectable.detectable.result.PropertyInsufficientDetectableResult)

Example 15 with Requirements

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

the class MavenProjectInspectorDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    Requirements requirements = new Requirements(fileFinder, environment);
    inspector = requirements.executable(projectInspectorResolver::resolveProjectInspector, "Project Inspector");
    return requirements.result();
}
Also used : Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Aggregations

Requirements (com.synopsys.integration.detectable.detectable.Requirements)63 File (java.io.File)7 PropertyInsufficientDetectableResult (com.synopsys.integration.detectable.detectable.result.PropertyInsufficientDetectableResult)3 FilesNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult)2 FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 Detectable (com.synopsys.integration.detectable.Detectable)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 SearchPattern (com.synopsys.integration.detectable.detectable.SearchPattern)1 DetectableInfo (com.synopsys.integration.detectable.detectable.annotation.DetectableInfo)1 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 FoundFile (com.synopsys.integration.detectable.detectable.explanation.FoundFile)1 PropertyProvided (com.synopsys.integration.detectable.detectable.explanation.PropertyProvided)1 DetectableResult (com.synopsys.integration.detectable.detectable.result.DetectableResult)1 FailedDetectableResult (com.synopsys.integration.detectable.detectable.result.FailedDetectableResult)1 NpmNodeModulesNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.NpmNodeModulesNotFoundDetectableResult)1 PackageResolvedNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.PackageResolvedNotFoundDetectableResult)1 PassedDetectableResult (com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)1 PackageResolvedExtractor (com.synopsys.integration.detectable.detectables.swift.lock.PackageResolvedExtractor)1 PackageResolvedResult (com.synopsys.integration.detectable.detectables.swift.lock.model.PackageResolvedResult)1 XcodeWorkspaceResult (com.synopsys.integration.detectable.detectables.xcode.model.XcodeWorkspaceResult)1