use of com.synopsys.integration.detectable.detectables.yarn.packagejson.WorkspacePackageJson in project synopsys-detect by blackducksoftware.
the class YarnTransformerTest method addWorkspacePackageJson.
private void addWorkspacePackageJson(Collection<YarnWorkspace> workspacesByName, NameVersion workspaceNameVersion, String workspaceDepName, String workspaceDevDepName) {
PackageJson rawWorkspacePackageJson = new PackageJson();
rawWorkspacePackageJson.name = workspaceNameVersion.getName();
rawWorkspacePackageJson.version = workspaceNameVersion.getVersion();
rawWorkspacePackageJson.dependencies = new HashMap<>();
rawWorkspacePackageJson.dependencies.put(workspaceDepName, workspaceNameVersion.getVersion());
rawWorkspacePackageJson.devDependencies.put(workspaceDevDepName, workspaceNameVersion.getVersion());
NullSafePackageJson workspacePackageJson = new NullSafePackageJson(rawWorkspacePackageJson);
WorkspacePackageJson locatedWorkspacePackageJson = new WorkspacePackageJson(null, workspacePackageJson, "packages/" + workspaceNameVersion.getName());
YarnWorkspace workspace = new YarnWorkspace(locatedWorkspacePackageJson);
workspacesByName.add(workspace);
}
Aggregations