Skip to content

Commit

Permalink
Fix build error with extensions
Browse files Browse the repository at this point in the history
Fix "Could not parse *-info.plist or config.xml". Proposed fix, see apache#764

Co-Authored-By: Leo Qiu <[email protected]>
  • Loading branch information
NiklasMerz and leogoesger committed Jan 14, 2020
1 parent e61a347 commit 24a2f73
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/templates/scripts/cordova/lib/projectFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,18 @@ function parseProjectFile (locations) {
const xcodeproj = xcode.project(pbxPath);
xcodeproj.parseSync();

const projectName = fs
.readdirSync(project_dir)
.find(d => d.includes(".xcworkspace"))
.replace(".xcworkspace", "");
const xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection();
const plist_file_entry = _.find(xcBuildConfiguration, entry => entry.buildSettings && entry.buildSettings.INFOPLIST_FILE);
const plist_file_entry = _.find(xcBuildConfiguration, entry => {
return (
entry.buildSettings &&
entry.buildSettings.INFOPLIST_FILE &&
entry.buildSettings.INFOPLIST_FILE.includes(projectName)
);
});
const plist_file = path.join(project_dir, plist_file_entry.buildSettings.INFOPLIST_FILE.replace(/^"(.*)"$/g, '$1').replace(/\\&/g, '&'));
const config_file = path.join(path.dirname(plist_file), 'config.xml');

Expand Down

0 comments on commit 24a2f73

Please sign in to comment.