Repository: cordova-lib Updated Branches: refs/heads/master 5d633ebb2 -> 2ef7f7667
CB-9813 Keep module-to-plugin mapping at hand. This information is handy for various use-cases. E.g. for preview application to provide only the plugins which are used by the application (instead of all of them, since they are built-in in the preview app on the device). The other is simulation (taco-simulation does need this info). Instead of trying to (unreliably) recover this information from module list, just keep track of it when it's known (at the prepare stage). This closes #322 Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/2ef7f766 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/2ef7f766 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/2ef7f766 Branch: refs/heads/master Commit: 2ef7f76671d19341c37628658715a3e24b194072 Parents: 5d633eb Author: Arzhan Kinzhalin <arzhan.i.kinzha...@intel.com> Authored: Thu Oct 15 15:21:27 2015 -0700 Committer: Tim Barham <tim.bar...@microsoft.com> Committed: Thu Oct 15 16:24:53 2015 -0700 ---------------------------------------------------------------------- cordova-lib/src/platforms/PlatformApiPoly.js | 3 ++- cordova-lib/src/plugman/browserify.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2ef7f766/cordova-lib/src/platforms/PlatformApiPoly.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/platforms/PlatformApiPoly.js b/cordova-lib/src/platforms/PlatformApiPoly.js index c981859..960f4de 100644 --- a/cordova-lib/src/platforms/PlatformApiPoly.js +++ b/cordova-lib/src/platforms/PlatformApiPoly.js @@ -566,7 +566,8 @@ PlatformApiPoly.prototype._addModulesInfo = function(plugin, targetDir) { var moduleName = plugin.id + '.' + ( moduleToInstall.name || moduleToInstall.src.match(/([^\/]+)\.js/)[1] ); var obj = { file: ['plugins', plugin.id, moduleToInstall.src].join('/'), - id: moduleName + id: moduleName, + pluginId: plugin.id }; if (moduleToInstall.clobbers.length > 0) { obj.clobbers = moduleToInstall.clobbers.map(function(o) { return o.target; }); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2ef7f766/cordova-lib/src/plugman/browserify.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/browserify.js b/cordova-lib/src/plugman/browserify.js index b9babf8..d3cda94 100644 --- a/cordova-lib/src/plugman/browserify.js +++ b/cordova-lib/src/plugman/browserify.js @@ -129,7 +129,12 @@ module.exports = function doBrowserify (project, platformApi, pluginInfoProvider .forEach(function(jsModule) { var moduleName = jsModule.name ? jsModule.name : path.basename(jsModule.src, '.js'); var moduleId = pluginInfo.id + '.' + moduleName; - var moduleMetadata = {file: jsModule.src, id: moduleId, name: moduleName}; + var moduleMetadata = { + file: jsModule.src, + id: moduleId, + name: moduleName, + pluginId: pluginInfo.id + }; if (jsModule.clobbers.length > 0) { moduleMetadata.clobbers = jsModule.clobbers.map(function(o) { return o.target; }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org