From b1d6ce9ca6c0d77345e05aa1f484af2f32cb4e81 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Tue, 11 Apr 2023 14:35:39 -0300 Subject: [PATCH] fix: xcode 14.3 appending IPHONEOS_DEPLOYMENT_TARGET instead of replacing it --- lib/services/xcconfig-service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/services/xcconfig-service.ts b/lib/services/xcconfig-service.ts index 4ee192548d..693f31619e 100644 --- a/lib/services/xcconfig-service.ts +++ b/lib/services/xcconfig-service.ts @@ -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}"`); }