Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACF4F1057C for ; Mon, 3 Jun 2013 21:01:33 +0000 (UTC) Received: (qmail 69940 invoked by uid 500); 3 Jun 2013 21:01:31 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 69547 invoked by uid 500); 3 Jun 2013 21:01:31 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 64751 invoked by uid 99); 3 Jun 2013 21:01:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 21:01:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5A1B7812A8C; Mon, 3 Jun 2013 21:01:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: cordova prepare now calls into plugman to ensure existing plugins have their config file changes propagated. Date: Mon, 3 Jun 2013 21:01:26 +0000 (UTC) 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 Authored: Mon Jun 3 14:01:20 2013 -0700 Committer: Fil Maj 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(); }); });