Skip to content

Commit

Permalink
feat(ios): always override xcconfig with user values (#5735)
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni authored Apr 29, 2023
1 parent d9ee84c commit 5b88e06
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/services/xcconfig-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export class XcconfigService implements IXcconfigService {
const escapedSourceFile = sourceFile.replace(/'/g, "\\'");

const mergeScript = `require 'xcodeproj';
sourceConfig = Xcodeproj::Config.new('${escapedDestinationFile}')
targetConfig = Xcodeproj::Config.new('${escapedSourceFile}')
if(sourceConfig.attributes.key?('IPHONEOS_DEPLOYMENT_TARGET') && targetConfig.attributes.key?('IPHONEOS_DEPLOYMENT_TARGET'))
sourceConfig.attributes.delete('IPHONEOS_DEPLOYMENT_TARGET')
userConfig = Xcodeproj::Config.new('${escapedDestinationFile}')
existingConfig = Xcodeproj::Config.new('${escapedSourceFile}')
userConfig.attributes.each do |key,|
existingConfig.attributes.delete(key) if (userConfig.attributes.key?(key) && existingConfig.attributes.key?(key))
end
sourceConfig.merge(targetConfig).save_as(Pathname.new('${escapedDestinationFile}'))`;
userConfig.merge(existingConfig).save_as(Pathname.new('${escapedDestinationFile}'))`;
await this.$childProcess.exec(`ruby -e "${mergeScript}"`);
}

Expand Down

0 comments on commit 5b88e06

Please sign in to comment.