From dbe4abd3a43021e14a87b9dbfdcfcfcf8cc91f1d Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Wed, 6 Aug 2014 15:36:59 -0700 Subject: [PATCH] Pass plugins and platforms from project --- tools/commands-cordova.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index 33122092b5..4cfd534c54 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -102,10 +102,6 @@ cordova.ensureCordovaProject = function (options, cordovaPath, bundlePath) { } var bundler = require(path.join(__dirname, 'bundler.js')); - var loader; - buildmessage.capture(function () { - loader = project.getPackageLoader(); - }); var webArchName = 'web.cordova'; @@ -204,7 +200,7 @@ cordova.ensureCordovaProject = function (options, cordovaPath, bundlePath) { var requiredPlugins = bundleResult.starManifest.cordovaDependencies; // XXX the project-level cordova plugins deps override the package-level ones - _.extend(requiredPlugins, project.cordovaPlugins); + _.extend(requiredPlugins, options.plugins || {}); _.each(requiredPlugins, function (version, name) { // no-op if this plugin is already installed @@ -325,6 +321,8 @@ main.registerCommand({ var projectOptions = _.pick(options, 'port', 'host'); projectOptions.appName = appName; projectOptions.cordovaSettings = cordovaSettings; + projectOptions.plugins = project.getCordovaPlugins(); + projectOptions.platforms = project.getCordovaPlatforms(); // XXX in Android simulators you can't access localhost and the correct way is // to use "10.0.2.2" instead. @@ -334,7 +332,7 @@ main.registerCommand({ if (_.contains(['emulate', 'build', 'prepare', 'compile', 'serve', 'create'], cordovaCommand)) { try { - ensureCordovaProject(projectOptions, cordovaPath, bundleDir); + cordova.ensureCordovaProject(projectOptions, cordovaPath, bundleDir); } catch (e) { process.stderr.write('Errors preventing the Cordova project from build:\n'); process.stderr.write(e.stack);