Search in sources :

Example 1 with PnpmProjectPackage

use of com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmProjectPackage in project synopsys-detect by blackducksoftware.

the class PnpmYamlTransformer method convertPnpmLockYamlToPnpmProjectPackage.

private PnpmProjectPackage convertPnpmLockYamlToPnpmProjectPackage(PnpmLockYaml pnpmLockYaml) {
    PnpmProjectPackage pnpmProjectPackage = new PnpmProjectPackage();
    pnpmProjectPackage.dependencies = pnpmLockYaml.dependencies;
    pnpmProjectPackage.devDependencies = pnpmLockYaml.devDependencies;
    pnpmProjectPackage.optionalDependencies = pnpmLockYaml.optionalDependencies;
    return pnpmProjectPackage;
}
Also used : PnpmProjectPackage(com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmProjectPackage)

Example 2 with PnpmProjectPackage

use of com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmProjectPackage in project synopsys-detect by blackducksoftware.

the class PnpmLockYamlParser method createCodeLocationsFromImports.

private List<CodeLocation> createCodeLocationsFromImports(File sourcePath, PnpmLockYaml pnpmLockYaml, PnpmLinkedPackageResolver linkedPackageResolver, @Nullable NameVersion projectNameVersion) throws IntegrationException {
    if (MapUtils.isEmpty(pnpmLockYaml.importers)) {
        return Collections.emptyList();
    }
    List<CodeLocation> codeLocations = new LinkedList<>();
    for (Map.Entry<String, PnpmProjectPackage> projectPackageInfo : pnpmLockYaml.importers.entrySet()) {
        String projectKey = projectPackageInfo.getKey();
        PnpmProjectPackage projectPackage = projectPackageInfo.getValue();
        NameVersion extractedNameVersion = extractProjectInfo(projectPackageInfo, linkedPackageResolver, projectNameVersion);
        String reportingProjectPackagePath = null;
        if (!isNodeRoot.evaluate(projectKey)) {
            reportingProjectPackagePath = projectKey;
        }
        File generatedSourcePath = generateCodeLocationSourcePath(sourcePath, reportingProjectPackagePath);
        codeLocations.add(pnpmTransformer.generateCodeLocation(generatedSourcePath, projectPackage, reportingProjectPackagePath, extractedNameVersion, pnpmLockYaml.packages, linkedPackageResolver));
    }
    return codeLocations;
}
Also used : PnpmProjectPackage(com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmProjectPackage) CodeLocation(com.synopsys.integration.detectable.detectable.codelocation.CodeLocation) NameVersion(com.synopsys.integration.util.NameVersion) Map(java.util.Map) File(java.io.File) LinkedList(java.util.LinkedList)

Aggregations

PnpmProjectPackage (com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmProjectPackage)2 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 NameVersion (com.synopsys.integration.util.NameVersion)1 File (java.io.File)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1