MCPcopy Create free account
hub / github.com/SAP/ui5-project / declareOptionalDependency

Method declareOptionalDependency

lib/graph/ProjectGraph.js:201–212  ·  view source on GitHub ↗

* Declare a dependency from one project in the graph to another * * @public * @param {string} fromProjectName Name of the depending project * @param {string} toProjectName Name of project on which the other depends

(fromProjectName, toProjectName)

Source from the content-addressed store, hash-verified

199 * @param {string} toProjectName Name of project on which the other depends
200 */
201 declareOptionalDependency(fromProjectName, toProjectName) {
202 this._checkSealed();
203 try {
204 log.verbose(`Declaring optional dependency: ${fromProjectName} depends on ${toProjectName}`);
205 this._declareDependency(this._optAdjList, fromProjectName, toProjectName);
206 this._hasUnresolvedOptionalDependencies = true;
207 } catch (err) {
208 throw new Error(
209 `Failed to declare optional dependency from project ${fromProjectName} to ${toProjectName}: ` +
210 err.message);
211 }
212 }
213
214 /**
215 * Declare a dependency from one project in the graph to another

Callers 3

projectGraphBuilderFunction · 0.95
ProjectGraph.jsFile · 0.80

Calls 2

_checkSealedMethod · 0.95
_declareDependencyMethod · 0.95

Tested by

no test coverage detected