I'm currently using .xcconfig files to manage various build settings for an iOS app and generally it works great. I've found if I only modify the value(s) in the .xconfig files between builds then those changes do not get built into the app. I'm currently mapping the value in my info.plist from the macro value.
For example I have a variable like ENDPOINT_URL = someURL.com/v1
. If later, the only change I make is making the modification ENDPOINT_URL = someURL.com/v2
, the value is change in my project's build settings. In my info.plist I'm mapping the entry like so EndpointURL: ${ENDPOINT_URL}
(not exact plist syntax but the general idea). But when reading it from my info.plist with [bundle objectForInfoDictionaryKey:@"EndpointURL"]
it still has the value someURL.com/v1
.
I've found that clean, delete derived data, restart Xcode generally works. But not always. And that isn't a great solution anyways.
Any thoughts on how to force Xcode to always use the value in my .xcconfig files? When creating the config files originally I saw an answer to add a build phase script that runs the touch
command on my project's main.m to force a codesign on build, but it doesn't seem to work.
Thanks!
edit According to https://stackoverflow.com/a/41845248/962024 this looks like an issue that should have been addressed in Xcode 8.3 (which I'm currently using). Looks like it's time to file a radar.