Github user omefire commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/235#discussion_r32238811 --- Diff: cordova-lib/src/cordova/prepare.js --- @@ -56,147 +53,44 @@ function prepare(options) { }) .then(function(){ options = cordova_util.preProcessOptions(options); - var paths = options.platforms.map(function(p) { + options.paths = options.platforms.map(function(p) { var platform_path = path.join(projectRoot, 'platforms', p); - var parser = platforms.getPlatformProject(p, platform_path); - return parser.www_dir(); + return platforms.getPlatformApi(p, platform_path).getWwwDir(); }); - options.paths = paths; }) .then(function() { var pluginInfoProvider = new PluginInfoProvider(); - // Iterate over each added platform return Q.all(options.platforms.map(function(platform) { var platformPath = path.join(projectRoot, 'platforms', platform); - - var parser = platforms.getPlatformProject(platform, platformPath); - var defaults_xml_path = path.join(platformPath, 'cordova', 'defaults.xml'); - // If defaults.xml is present, overwrite platform config.xml with - // it Otherwise save whatever is there as defaults so it can be - // restored or copy project config into platform if none exists. - if (fs.existsSync(defaults_xml_path)) { - shell.cp('-f', defaults_xml_path, parser.config_xml()); - events.emit('verbose', 'Generating config.xml from defaults for platform "' + platform + '"'); - } else { - if(fs.existsSync(parser.config_xml())){ - shell.cp('-f', parser.config_xml(), defaults_xml_path); - }else{ - shell.cp('-f', xml, parser.config_xml()); + var platformApi = platforms.getPlatformApi(platform, platformPath); + + return platformApi.updateWww(projectWww) + .then(function () { + return platformApi.updateConfig(projectConfig); + }).then(function () { + // Call plugman --prepare for this platform. sets up js-modules appropriately. + var plugins_dir = path.join(projectRoot, 'plugins'); + var platformPath = path.join(projectRoot, 'platforms', platform); --- End diff -- platformPath has already been defined.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org