Search in sources :

Example 1 with WorkspacePackageJson

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);
}
Also used : WorkspacePackageJson(com.synopsys.integration.detectable.detectables.yarn.packagejson.WorkspacePackageJson) NullSafePackageJson(com.synopsys.integration.detectable.detectables.yarn.packagejson.NullSafePackageJson) NullSafePackageJson(com.synopsys.integration.detectable.detectables.yarn.packagejson.NullSafePackageJson) WorkspacePackageJson(com.synopsys.integration.detectable.detectables.yarn.packagejson.WorkspacePackageJson) PackageJson(com.synopsys.integration.detectable.detectables.npm.packagejson.model.PackageJson) YarnWorkspace(com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspace)

Aggregations

PackageJson (com.synopsys.integration.detectable.detectables.npm.packagejson.model.PackageJson)1 NullSafePackageJson (com.synopsys.integration.detectable.detectables.yarn.packagejson.NullSafePackageJson)1 WorkspacePackageJson (com.synopsys.integration.detectable.detectables.yarn.packagejson.WorkspacePackageJson)1 YarnWorkspace (com.synopsys.integration.detectable.detectables.yarn.workspace.YarnWorkspace)1