You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2019/03/15 06:12:32 UTC

[cordova-lib] branch master updated: Pass project config.xml path to platform's prepare (#751)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-lib.git


The following commit(s) were added to refs/heads/master by this push:
     new b5edb57  Pass project config.xml path to platform's prepare (#751)
b5edb57 is described below

commit b5edb57b6f0e86cf3d764df1d13afa2e6833b157
Author: Darryl Pogue <da...@dpogue.ca>
AuthorDate: Thu Mar 14 23:12:27 2019 -0700

    Pass project config.xml path to platform's prepare (#751)
    
    Currently we're passing in an already-constructed ConfigParser instance
    as part of the fake projectInfo object, but the problem is that it's
    constructed with the version of cordova-common depended on by
    *cordova-lib* as opposed to the version of cordova-common depended on by
    the *platform*. By passing the path in, we can construct the
    ConfigParser at the Platform API level, using the correct version.
    
    In the meantime, for compatibility reasons, we have to keep passing in a
    ConfigParser instance, and the Platform API needs to handle the case
    where rootConfigXml is undefined and it needs to fetch the path out of
    the existing ConfigParser instance and then overwrite it with a newly
    constructed ConfigParser.
    
    We should at some point look into making this "root project info" object
    a class in cordova-common so that we can document what it's expected to
    contain and rely on that both here and in the platforms.
---
 src/cordova/prepare.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/cordova/prepare.js b/src/cordova/prepare.js
index 20dc52b..c832ef3 100644
--- a/src/cordova/prepare.js
+++ b/src/cordova/prepare.js
@@ -86,7 +86,8 @@ function preparePlatforms (platformList, projectRoot, options) {
             projectConfig: new ConfigParser(cordova_util.projectConfig(projectRoot)),
             locations: {
                 plugins: path.join(projectRoot, 'plugins'),
-                www: cordova_util.projectWww(projectRoot)
+                www: cordova_util.projectWww(projectRoot),
+                rootConfigXml: cordova_util.projectConfig(projectRoot)
             }
         };
         // CB-9987 We need to reinstall the plugins for the platform it they were added by cordova@<5.4.0


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