cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: cordova prepare now calls into plugman to ensure existing plugins have their config file changes propagated.
Date Mon, 03 Jun 2013 21:01:26 GMT
Updated Branches:
  refs/heads/ensure_config [created] b88014457


cordova prepare now calls into plugman to ensure existing plugins have their config file changes
propagated.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/b8801445
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/b8801445
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/b8801445

Branch: refs/heads/ensure_config
Commit: b880144572ee80be1e9dfd30e37d1c46f8314944
Parents: e0f5477
Author: Fil Maj <maj.fil@gmail.com>
Authored: Mon Jun 3 14:01:20 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Jun 3 14:01:20 2013 -0700

----------------------------------------------------------------------
 src/prepare.js |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b8801445/src/prepare.js
----------------------------------------------------------------------
diff --git a/src/prepare.js b/src/prepare.js
index 523d90b..b5c66ee 100644
--- a/src/prepare.js
+++ b/src/prepare.js
@@ -80,9 +80,21 @@ module.exports = function prepare(platforms, callback) {
         var parser = new parsers[platform](platformPath);
 
         parser.update_project(cfg, function() {
-            // Call plugman --prepare for this platform.
-            plugman.prepare(platformPath, platform, path.join(projectRoot, 'plugins'));
+            // Call plugman --prepare for this platform. sets up js-modules appropriately.
+            var plugins_dir = path.join(projectRoot, 'plugins');
+            plugman.prepare(platformPath, platform, plugins_dir);
 
+            // Make sure that config changes for each existing plugin is in place
+            var plugins = cordova_util.findPlugins(plugins_dir);
+            var platform_json = plugman.config_changes.get_platform_json(plugins_dir, platform);
+            plugins.forEach(function(plugin_id) {
+                if (platform_json.installed_plugins[plugin_id]) {
+                    console.log('readding ' + plugin_id);
+                    plugman.config_changes.add_plugin_changes(platform, platformPath, plugins_dir,
plugin_id, /* variables for plugin */ platform_json.installed_plugins[plugin_id], /* top level
plugin? */ true, /* should increment config munge? cordova-cli never should, only plugman
*/ false);
+                } else if (platform_json.dependent_plugins[plugin_id]) {
+                    plugman.config_changes.add_plugin_changes(platform, platformPath, plugins_dir,
plugin_id, /* variables for plugin */ platform_json.dependent_plugins[plugin_id], /* top level
plugin? */ false, /* should increment config munge? cordova-cli never should, only plugman
*/ false);
+                }
+            });
             end();
         });
     });


Mime
View raw message