MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / _notifyAddonIncluded

Method _notifyAddonIncluded

lib/broccoli/ember-app.js:443–471  ·  view source on GitHub ↗

Calls the included hook on addons. @private @method _notifyAddonIncluded

()

Source from the content-addressed store, hash-verified

441 @method _notifyAddonIncluded
442 */
443 _notifyAddonIncluded() {
444 let addonNames = this.project.addons.map((addon) => addon.name);
445
446 if (this.options.addons.exclude) {
447 this.options.addons.exclude.forEach((addonName) => {
448 if (addonNames.indexOf(addonName) === -1) {
449 throw new Error(`Addon "${addonName}" defined in "exclude" is not found`);
450 }
451 });
452 }
453
454 if (this.options.addons.include) {
455 this.options.addons.include.forEach((addonName) => {
456 if (addonNames.indexOf(addonName) === -1) {
457 throw new Error(`Addon "${addonName}" defined in "include" is not found`);
458 }
459 });
460 }
461
462 // the addons must be filtered before the `included` hook is called
463 // in case an addon caches the project.addons list
464 this.project.addons = this.project.addons.filter((addon) => this.shouldIncludeAddon(addon));
465
466 this.project.addons.forEach((addon) => {
467 if (addon.included) {
468 addon.included(this);
469 }
470 });
471 }
472
473 /**
474 Calls the importTransforms hook on addons.

Callers 1

constructorMethod · 0.95

Calls 2

shouldIncludeAddonMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected