(isopk, {
uses,
isopackCache,
pluginProviderPackageNames,
pluginProviderWatchSet
})
| 864 | // takes an isopack and returns a list of packages isopack depends on, |
| 865 | // containing at least one plugin |
| 866 | export function getActivePluginPackages(isopk, { |
| 867 | uses, |
| 868 | isopackCache, |
| 869 | pluginProviderPackageNames, |
| 870 | pluginProviderWatchSet |
| 871 | }) { |
| 872 | // XXX we used to include our own plugins only if we were the |
| 873 | // "use" role. now we include them everywhere because we don't have |
| 874 | // a special "use" role anymore. it's not totally clear to me what |
| 875 | // the correct behavior should be -- we need to resolve whether we |
| 876 | // think about plugins as being global to a package or particular |
| 877 | // to a unibuild. |
| 878 | |
| 879 | // (there's also some weirdness here with handling implies, because |
| 880 | // the implies field is on the target unibuild, but we really only care |
| 881 | // about packages.) |
| 882 | var activePluginPackages = [isopk]; |
| 883 | if (pluginProviderPackageNames) { |
| 884 | pluginProviderPackageNames[isopk.name] = true; |
| 885 | } |
| 886 | |
| 887 | // We don't use plugins from weak dependencies, because the ability |
| 888 | // to compile a certain type of file shouldn't depend on whether or |
| 889 | // not some unrelated package in the target has a dependency. And we |
| 890 | // skip unordered dependencies, because it's not going to work to |
| 891 | // have circular build-time dependencies. |
| 892 | // |
| 893 | // eachUsedUnibuild takes care of pulling in implied dependencies for us (eg, |
| 894 | // templating from standard-app-packages). |
| 895 | // |
| 896 | // We pass archinfo.host here, not self.arch, because it may be more specific, |
| 897 | // and because plugins always have to run on the host architecture. |
| 898 | compiler.eachUsedUnibuild({ |
| 899 | dependencies: uses, |
| 900 | arch: archinfo.host(), |
| 901 | isopackCache: isopackCache, |
| 902 | skipUnordered: true |
| 903 | // implicitly skip weak deps by not specifying acceptableWeakPackages option |
| 904 | }, function (unibuild) { |
| 905 | if (unibuild.pkg.name === isopk.name) { |
| 906 | return; |
| 907 | } |
| 908 | if (pluginProviderPackageNames) { |
| 909 | pluginProviderPackageNames[unibuild.pkg.name] = true; |
| 910 | } |
| 911 | if (pluginProviderWatchSet) { |
| 912 | pluginProviderWatchSet.merge(unibuild.pkg.pluginWatchSet); |
| 913 | } |
| 914 | if (_.isEmpty(unibuild.pkg.plugins)) { |
| 915 | return; |
| 916 | } |
| 917 | activePluginPackages.push(unibuild.pkg); |
| 918 | }); |
| 919 | |
| 920 | activePluginPackages = _.uniq(activePluginPackages); |
| 921 | return activePluginPackages; |
| 922 | } |
| 923 |
no test coverage detected
searching dependent graphs…