Skip to content

Commit e6c09c0

Browse files
authored
fix: correctly merge IPHONEOS_DEPLOYMENT_TARGET in xcconfigs (#5728)
1 parent c35673e commit e6c09c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/services/xcconfig-service.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ export class XcconfigService implements IXcconfigService {
4242
const escapedDestinationFile = destinationFile.replace(/'/g, "\\'");
4343
const escapedSourceFile = sourceFile.replace(/'/g, "\\'");
4444

45-
const mergeScript = `require 'xcodeproj'; Xcodeproj::Config.new('${escapedDestinationFile}').merge(Xcodeproj::Config.new('${escapedSourceFile}')).save_as(Pathname.new('${escapedDestinationFile}'))`;
45+
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')
50+
end
51+
sourceConfig.merge(targetConfig).save_as(Pathname.new('${escapedDestinationFile}'))`;
4652
await this.$childProcess.exec(`ruby -e "${mergeScript}"`);
4753
}
4854

0 commit comments

Comments
 (0)