Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C826617227 for ; Wed, 8 Apr 2015 08:55:16 +0000 (UTC) Received: (qmail 21210 invoked by uid 500); 8 Apr 2015 08:55:16 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 21167 invoked by uid 500); 8 Apr 2015 08:55:16 -0000 Mailing-List: contact dev-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 dev@cordova.apache.org Received: (qmail 21156 invoked by uid 99); 8 Apr 2015 08:55:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 08:55:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D4B28E02A1; Wed, 8 Apr 2015 08:55:15 +0000 (UTC) From: TimBarham To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org Message-ID: Subject: [GitHub] cordova-lib pull request: CB-8807 Platform Add fails to add plugin... Content-Type: text/plain Date: Wed, 8 Apr 2015 08:55:15 +0000 (UTC) GitHub user TimBarham opened a pull request: https://github.com/apache/cordova-lib/pull/205 CB-8807 Platform Add fails to add plugins with variables. When a plugin that uses variables is automatically installed for a new platform, it fails with the following exception: Installing "[plugin]" for [platform] Failed to install '[plugin]':Error: Variable(s) missing: [variables] at .../cordova-lib/src/plugman/install.js:299:23 at ... The problem here is that we are looking in `config.xml` for information about the plugin's variables, but the plugin is only saved to `config.xml` if it was added with the `--save` flag. This fix updates the logic to look in `fetch.json` instead. I believe looking in `fetch.json` is the right thing to do here, regardless, for the following reasons: * `fetch.json` is the one that is guaranteed to be up-to-date. * the information we store in `config.xml` is used to restore plugins that have been uninstalled. The information we store in `fetch.json` describes currently installed plugins, which is what we're working with here. Consider the following scenario: 1. Add a plugin with variables, using the `--save` option. Variable information is saved to `config.xml` and `fetch.json`. 2. Remove the plugin (with the `--save` option). The variable information is removed from `fetch.json`, but remains in `config.xml`. 3. Add the plugin again, with different variable values, without the `--save` option. The current variable information is in `fetch.json`, but not in `config.xml`. Also, each platform currently installed will be using the new variable information. 4. Add a platform. If, when we install the plugin for the new platform, we retrieve the variables from `config.xml`, it will be out of sync with platforms that were already installed. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-lib CB-8807 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/205.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #205 ---- commit 5d9d4483ca15b883886ff8cae98f3fd6744a7c99 Author: Tim Barham Date: 2015-04-07T13:22:46Z CB-8807 Platform Add fails to add plugins with variables. When a plugin that uses variables is automatically installed for a new platform, it fails with the following exception: Installing "[plugin]" for [platform] Failed to install '[plugin]':Error: Variable(s) missing: [variables] at .../cordova-lib/src/plugman/install.js:299:23 at ... The problem here is that we are looking in config.xml for information about the plugins variables, but the plugin is only saved to config.xml if it was added with the --save flag. This fix updates the logic to look in fetch.json instead. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org