Search in sources :

Example 6 with YarnWorkspace

use of com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspace in project synopsys-detect by blackducksoftware.

the class YarnLockExtractor method collectWorkspaceData.

@NotNull
private YarnWorkspaces collectWorkspaceData(File dir) throws IOException {
    Collection<YarnWorkspace> curLevelWorkspaces = packageJsonFiles.readWorkspacePackageJsonFiles(dir);
    Collection<YarnWorkspace> allWorkspaces = new LinkedList<>(curLevelWorkspaces);
    for (YarnWorkspace workspace : curLevelWorkspaces) {
        Collection<YarnWorkspace> treeBranchWorkspacePackageJsons = packageJsonFiles.readWorkspacePackageJsonFiles(workspace.getWorkspacePackageJson().getDir());
        allWorkspaces.addAll(treeBranchWorkspacePackageJsons);
    }
    return new YarnWorkspaces(allWorkspaces);
}
Also used : YarnWorkspaces(com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspaces) YarnWorkspace(com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspace) LinkedList(java.util.LinkedList) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

YarnWorkspace (com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspace)6 LinkedList (java.util.LinkedList)4 NotNull (org.jetbrains.annotations.NotNull)3 PackageJson (com.synopsys.integration.detectable.detectables.npm.packagejson.model.PackageJson)2 NullSafePackageJson (com.synopsys.integration.detectable.detectables.yarn.packagejson.NullSafePackageJson)2 WorkspacePackageJson (com.synopsys.integration.detectable.detectables.yarn.packagejson.WorkspacePackageJson)2 YarnWorkspaces (com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspaces)2 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 LazyId (com.synopsys.integration.bdio.graph.builder.LazyId)1 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)1 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 YarnLock (com.synopsys.integration.detectable.detectables.yarn.parse.YarnLock)1 YarnLockDependency (com.synopsys.integration.detectable.detectables.yarn.parse.YarnLockDependency)1 YarnLockResult (com.synopsys.integration.detectable.detectables.yarn.parse.YarnLockResult)1 YarnLockEntry (com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntry)1 YarnLockEntryId (com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntryId)1 NameVersion (com.synopsys.integration.util.NameVersion)1 File (java.io.File)1 IOException (java.io.IOException)1 FileVisitResult (java.nio.file.FileVisitResult)1