Skip to content

Commit 5b88e06

Browse files
authored
feat(ios): always override xcconfig with user values (#5735)
1 parent d9ee84c commit 5b88e06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/services/xcconfig-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ export class XcconfigService implements IXcconfigService {
4343
const escapedSourceFile = sourceFile.replace(/'/g, "\\'");
4444

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

0 commit comments

Comments
 (0)