* Join another project graph into this one. * Projects and extensions which already exist in this graph will cause an error to be thrown * * @public * @param {@ui5/project/graph/ProjectGraph} projectGraph Project Graph to merge into this one
(projectGraph)
| 483 | * @param {@ui5/project/graph/ProjectGraph} projectGraph Project Graph to merge into this one |
| 484 | */ |
| 485 | join(projectGraph) { |
| 486 | try { |
| 487 | this._checkSealed(); |
| 488 | if (!projectGraph.isSealed()) { |
| 489 | // Seal input graph to prevent further modification |
| 490 | log.verbose( |
| 491 | `Sealing project graph with root project ${projectGraph._rootProjectName} ` + |
| 492 | `before joining it into project graph with root project ${this._rootProjectName}...`); |
| 493 | projectGraph.seal(); |
| 494 | } |
| 495 | mergeMap(this._projects, projectGraph._projects); |
| 496 | mergeMap(this._extensions, projectGraph._extensions); |
| 497 | mergeMap(this._adjList, projectGraph._adjList); |
| 498 | mergeMap(this._optAdjList, projectGraph._optAdjList); |
| 499 | |
| 500 | this._hasUnresolvedOptionalDependencies = |
| 501 | this._hasUnresolvedOptionalDependencies || projectGraph._hasUnresolvedOptionalDependencies; |
| 502 | } catch (err) { |
| 503 | throw new Error( |
| 504 | `Failed to join project graph with root project ${projectGraph._rootProjectName} into ` + |
| 505 | `project graph with root project ${this._rootProjectName}: ${err.message}`); |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | // Only to be used by @ui5/builder tests to inject its version of the taskRepository |
| 510 | setTaskRepository(taskRepository) { |
no test coverage detected