diff --git a/CHANGELOG.md b/CHANGELOG.md index 932316761..3f2d5571e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Fixed framework search paths when using `.xcframework`s. [#1015](https://github.com/yonaskolb/XcodeGen/pull/1015) @FranzBusch - Fixed bug where schemes without a build target would crash instead of displaying an error [#1040](https://github.com/yonaskolb/XcodeGen/pull/1040) @dalemyers - Fixed files with names ending in **Info.plist** (such as **GoogleServices-Info.plist**) from being omitted from the Copy Resources build phase. Now, only the resolved info plist file for each specific target is omitted. [#1027](https://github.com/yonaskolb/XcodeGen/pull/1027) @liamnichols +- Prevent setting presets from overwriting settings in target xcconfig files. [#924](https://github.com/yonaskolb/XcodeGen/pull/924) @k-thorat #### Internal - Build universal binaries for release. XcodeGen now runs natively on Apple Silicon. [#1024](https://github.com/yonaskolb/XcodeGen/pull/1024) @thii diff --git a/Sources/XcodeGenKit/SettingsBuilder.swift b/Sources/XcodeGenKit/SettingsBuilder.swift index 4ac1853c3..79bfb3e59 100644 --- a/Sources/XcodeGenKit/SettingsBuilder.swift +++ b/Sources/XcodeGenKit/SettingsBuilder.swift @@ -55,6 +55,8 @@ extension Project { buildSettings[target.platform.deploymentTargetSetting] = version.deploymentTarget } + buildSettings += getBuildSettings(settings: target.settings, config: config) + // Prevent setting presets from overrwriting settings in target xcconfig files if let configPath = target.configFiles[config.name] { buildSettings = removeConfigFileSettings(from: buildSettings, configPath: configPath) @@ -64,8 +66,6 @@ extension Project { buildSettings = removeConfigFileSettings(from: buildSettings, configPath: configPath) } - buildSettings += getBuildSettings(settings: target.settings, config: config) - return buildSettings } diff --git a/Tests/Fixtures/settings_test.yml b/Tests/Fixtures/settings_test.yml index ae7cf20db..3d3b45ce9 100644 --- a/Tests/Fixtures/settings_test.yml +++ b/Tests/Fixtures/settings_test.yml @@ -71,10 +71,15 @@ targets: Target: type: application platform: iOS + configFiles: + # To verify build setting merge we need to duplicate setting in configFiles and settings + # BASE_SETTING: baseSetting is defined in base.xcconfig and for this target under settings:base: + config1: TestProject/Configs/base.xcconfig settings: groups: - preset7 base: + BASE_SETTING: baseSetting SETTING 2: value 2 configs: config1: