Skip to content

Commit 19fbac7

Browse files
committed
Prevent setting presets from overwriting settings in target xcconfig files
added comment for test config change changelog updated
1 parent dddb0fc commit 19fbac7

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#### Fixed
99
- Allow SDK dependencies to be embedded. [#922](https://github.com/yonaskolb/XcodeGen/pull/922) @k-thorat
10+
- Prevent setting presets from overwriting settings in target xcconfig files. [#924](https://github.com/yonaskolb/XcodeGen/pull/924) @k-thorat
1011

1112
## 2.17.0
1213

Sources/XcodeGenKit/SettingsBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ extension Project {
5555
buildSettings[target.platform.deploymentTargetSetting] = version.deploymentTarget
5656
}
5757

58+
buildSettings += getBuildSettings(settings: target.settings, config: config)
59+
5860
// Prevent setting presets from overrwriting settings in target xcconfig files
5961
if let configPath = target.configFiles[config.name] {
6062
buildSettings = removeConfigFileSettings(from: buildSettings, configPath: configPath)
@@ -64,8 +66,6 @@ extension Project {
6466
buildSettings = removeConfigFileSettings(from: buildSettings, configPath: configPath)
6567
}
6668

67-
buildSettings += getBuildSettings(settings: target.settings, config: config)
68-
6969
return buildSettings
7070
}
7171

Tests/Fixtures/settings_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,15 @@ targets:
7171
Target:
7272
type: application
7373
platform: iOS
74+
configFiles:
75+
# To verify build setting merge we need to duplicate setting in configFiles and settings
76+
# BASE_SETTING: baseSetting is defined in base.xcconfig and for this target under settings:base:
77+
config1: TestProject/Configs/base.xcconfig
7478
settings:
7579
groups:
7680
- preset7
7781
base:
82+
BASE_SETTING: baseSetting
7883
SETTING 2: value 2
7984
configs:
8085
config1:

0 commit comments

Comments
 (0)