While configuring a project using Tuist 4.30 (It was happend in Tuist 4.26 also), I encountered instances where xcconfig values were overridden by Tuist. If a key in the build settings exists as a property of the target, I was able to resolve this by specifying the key value or using the settings’ excluding feature. However, for the TEST_HOST of the UnitTest target, I was unable to prevent the overriding by any means, even with defaultsSettings: .none.
Ultimately, I resolved this by adding code to the settings.
Furthermore, since it seems there are exceptional cases like this, I changed the approach to avoid using xcconfig and instead only add settings through code.
Are there cases where it is impossible to prevent such overriding?
let project = Project(
name: "unittest",
settings: .settings(configurations: [
.debug(name: "TEST2", xcconfig: .relativeToRoot("test.xcconfig")) // TEST_HOST = "asdfasdf"
], defaultSettings: .none),
targets: [
.target(
name: "unittest",
destinations: .iOS,
product: .app,
bundleId: "io.tuist.unittest",
infoPlist: .extendingDefault(
with: [
"UILaunchScreen": [
"UIColorName": "",
"UIImageName": "",
],
]
),
sources: ["unittest/Sources/**"],
resources: ["unittest/Resources/**"],
dependencies: []
),
.target(
name: "unittestTests",
destinations: .iOS,
product: .unitTests,
bundleId: "io.tuist.unittestTests",
infoPlist: .default,
sources: ["unittest/Tests/**"],
resources: [],
dependencies: [.target(name: "unittest")],
settings: .settings(configurations: [
.debug(name: "TEST", xcconfig: .relativeToRoot("test.xcconfig"))
], defaultSettings: .none)
),
]
)