Skip to content

Commit

Permalink
fix: correctly merge IPHONEOS_DEPLOYMENT_TARGET in xcconfigs (#5728)
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni authored Apr 12, 2023
1 parent c35673e commit e6c09c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/services/xcconfig-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export class XcconfigService implements IXcconfigService {
const escapedDestinationFile = destinationFile.replace(/'/g, "\\'");
const escapedSourceFile = sourceFile.replace(/'/g, "\\'");

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

Expand Down

0 comments on commit e6c09c0

Please sign in to comment.