You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/09/03 09:15:05 UTC

cordova-lib git commit: CB-9604 Fix error adding browser platform with PlatformApi polyfill.

Repository: cordova-lib
Updated Branches:
  refs/heads/master 07271a5c6 -> 3951a990c


CB-9604 Fix error adding browser platform with PlatformApi polyfill.

Don't try to create ConfigParser() in PlatformApiPoly constructor, since we may not have copied the config.xml file into place yet. Instead, create it once we know we have the config.xml file.


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

Branch: refs/heads/master
Commit: 3951a990c8aff149cb45b6fa6af6ace0400ab01c
Parents: 07271a5
Author: Tim Barham <ti...@microsoft.com>
Authored: Thu Sep 3 11:34:19 2015 +1000
Committer: Tim Barham <ti...@microsoft.com>
Committed: Thu Sep 3 11:34:19 2015 +1000

----------------------------------------------------------------------
 cordova-lib/src/platforms/PlatformApiPoly.js | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/3951a990/cordova-lib/src/platforms/PlatformApiPoly.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/platforms/PlatformApiPoly.js b/cordova-lib/src/platforms/PlatformApiPoly.js
index 183bc4d..70869d8 100644
--- a/cordova-lib/src/platforms/PlatformApiPoly.js
+++ b/cordova-lib/src/platforms/PlatformApiPoly.js
@@ -64,8 +64,6 @@ function PlatformApiPoly(platform, platformRootDir) {
     this._platformJson = PlatformJson.load(this.root, platform);
     this._pluginInfoProvider = new PluginInfoProvider();
     this._munger = new PlatformMunger(platform, this.root, this._platformJson, this._pluginInfoProvider);
-
-    this._config = new ConfigParser(this.getPlatformInfo().locations.configXml);
 }
 
 /**
@@ -181,10 +179,10 @@ PlatformApiPoly.prototype.getPlatformInfo = function () {
  *   CordovaError instance.
  */
 PlatformApiPoly.prototype.prepare = function (cordovaProject) {
-
     // First cleanup current config and merge project's one into own
     var defaultConfig = path.join(this.root, 'cordova', 'defaults.xml');
-    var ownConfig = this._config.path;
+    var ownConfig = this.getPlatformInfo().locations.configXml;
+
     var sourceCfg = cordovaProject.projectConfig.path;
     // If defaults.xml is present, overwrite platform config.xml with it.
     // Otherwise save whatever is there as defaults so it can be
@@ -192,14 +190,14 @@ PlatformApiPoly.prototype.prepare = function (cordovaProject) {
     if (fs.existsSync(defaultConfig)) {
         // events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
         shell.cp('-f', defaultConfig, ownConfig);
-        this._config = new ConfigParser(ownConfig);
     } else if (fs.existsSync(ownConfig)) {
         shell.cp('-f', ownConfig, defaultConfig);
     } else {
         shell.cp('-f', sourceCfg.path, ownConfig);
-        this._config = new ConfigParser(ownConfig);
     }
 
+    this._config = new ConfigParser(ownConfig);
+
     xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
         this._config.doc.getroot(), this.platform, true);
     // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org