Merge pull request #691 from dpogue/common-configparser

Run prepare with the correct ConfigParser version
This commit is contained in:
Darryl Pogue 2019-03-15 11:08:35 -07:00 committed by GitHub
commit 9531dbbc7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ var PluginManager = require('cordova-common').PluginManager;
var CordovaLogger = require('cordova-common').CordovaLogger; var CordovaLogger = require('cordova-common').CordovaLogger;
var selfEvents = require('cordova-common').events; var selfEvents = require('cordova-common').events;
var ConfigParser = require('cordova-common').ConfigParser;
var PLATFORM = 'android'; var PLATFORM = 'android';
@ -71,10 +72,7 @@ function Api (platform, platformRootDir, events) {
strings: path.join(appRes, 'values', 'strings.xml'), strings: path.join(appRes, 'values', 'strings.xml'),
manifest: path.join(appMain, 'AndroidManifest.xml'), manifest: path.join(appMain, 'AndroidManifest.xml'),
build: path.join(this.root, 'build'), build: path.join(this.root, 'build'),
javaSrc: path.join(appMain, 'java'), javaSrc: path.join(appMain, 'java')
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
}; };
} }
@ -174,6 +172,8 @@ Api.prototype.getPlatformInfo = function () {
* CordovaError instance. * CordovaError instance.
*/ */
Api.prototype.prepare = function (cordovaProject, prepareOptions) { Api.prototype.prepare = function (cordovaProject, prepareOptions) {
cordovaProject.projectConfig = new ConfigParser(cordovaProject.locations.rootConfigXml || cordovaProject.projectConfig.path);
return require('./lib/prepare').prepare.call(this, cordovaProject, prepareOptions); return require('./lib/prepare').prepare.call(this, cordovaProject, prepareOptions);
}; };