* Discovers all child addons of this addon and an AddonInfo about * each addon in this.addonPackages (keyed on addon name). * * Child addons include those from 'dependencies' (not devDependencies) * and in-repo addons * * Any packageInfos that we find that are marked as not valid a
()
| 419 | * @method discoverAddons |
| 420 | */ |
| 421 | discoverAddons() { |
| 422 | // prefer `packageRoot`, fallback to `root`; this is to maintain backwards compatibility for |
| 423 | // consumers who create a new instance of the base addon model class directly and don't set |
| 424 | // `packageRoot` |
| 425 | let pkgInfo = this.packageInfoCache.getEntry(this.packageRoot || this.root); |
| 426 | |
| 427 | if (pkgInfo) { |
| 428 | let addonPackageList = pkgInfo.discoverAddonAddons(); |
| 429 | this.addonPackages = pkgInfo.generateAddonPackages( |
| 430 | addonPackageList, |
| 431 | (addonInfo) => this.shouldIncludeChildAddon && !this.shouldIncludeChildAddon(addonInfo) |
| 432 | ); |
| 433 | |
| 434 | // in case any child addons are invalid, dump to the console about them. |
| 435 | pkgInfo.dumpInvalidAddonPackages(addonPackageList); |
| 436 | } else { |
| 437 | // There are cases where an addon can be created in memory and not actually |
| 438 | // have a root entry (or have one that is not actually pointing to a directory, |
| 439 | // like 'foo' in some of the tests. We don't want to crash, but want to let |
| 440 | // things continue even though they're empty. |
| 441 | this.addonPackages = Object.create(null); |
| 442 | } |
| 443 | }, |
| 444 | |
| 445 | initializeAddons() { |
| 446 | if (this._addonsInitialized) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…