Calls the included hook on addons. @private @method _notifyAddonIncluded
()
| 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. |
no test coverage detected