Remember the library resolution of packages used by the plugin program itself.

This commit is contained in:
David Glasser
2013-08-01 12:41:49 -07:00
parent 8de4b48d61
commit e483721602
2 changed files with 20 additions and 1 deletions

View File

@@ -404,6 +404,9 @@ var Target = function (options) {
// On-disk dependencies of this target.
self.watchSet = new watch.WatchSet();
// Map from package name to package directory of all packages used.
self.pluginProviderPackageDirs = {};
// node_modules directories that we need to copy into the target (or
// otherwise make available at runtime.) A map from an absolute path
// on disk (NodeModulesDirectory.sourcePath) to a
@@ -671,6 +674,11 @@ _.extend(Target.prototype, {
// Depend on the source files that produced these resources.
self.watchSet.merge(slice.watchSet);
// Remember the library resolution of all packages used in these
// resources.
// XXX assumes that this merges cleanly
_.extend(self.pluginProviderPackageDirs,
slice.pkg.pluginProviderPackageDirs)
});
},
@@ -706,6 +714,11 @@ _.extend(Target.prototype, {
return self.watchSet;
},
getPluginProviderPackageDirs: function () {
var self = this;
return self.pluginProviderPackageDirs;
},
// Return the most inclusive architecture with which this target is
// compatible. For example, if we set out to build a
// 'os.linux.x86_64' version of this target (by passing that as
@@ -1830,7 +1843,8 @@ exports.buildJsImage = function (options) {
return {
image: target.toJsImage(),
watchSet: target.getWatchSet()
watchSet: target.getWatchSet(),
pluginProviderPackageDirs: target.getPluginProviderPackageDirs()
};
};

View File

@@ -1006,6 +1006,11 @@ _.extend(Package.prototype, {
// Add this plugin's dependencies to our "plugin dependency" WatchSet.
self.pluginWatchSet.merge(buildResult.watchSet);
// Remember the library resolution of all packages used by the plugin.
// XXX assumes that this merges cleanly
_.extend(self.pluginProviderPackageDirs,
buildResult.pluginProviderPackageDirs);
// Register the built plugin's code.
self.plugins[info.name] = buildResult.image;
});