-
Notifications
You must be signed in to change notification settings - Fork 483
Closed
Description
Variables defined in xcconfig files and then used in build settings are not properly resolved.
Here's a sample project:
https://github.com/mgrebenets/XcodeprojBuildSettingsDemo
For example, PROVISIONING_PROFILE_SPECIFIER build setting is configured like so:

Both variables are defined in xcconfig files and are correctly resolved by Xcode:

The variables are also properly resolved by xcodebuild -showBuildSettings, for example:
xcodebuild -showBuildSettings -project XcodeprojBuildSettingsDemo.xcodeproj` -configuration Release
# Output:
# PROVISIONING_PROFILE_SPECIFIER = au.com.company.app
xcodebuild -showBuildSettings -project XcodeprojBuildSettingsDemo.xcodeproj` -configuration Debug
# Output:
# PROVISIONING_PROFILE_SPECIFIER = match Development dev-au.com.company.app.prod
Using xcodeproj gem, however, fails to resolve the build settings:
path = 'path/to/XcodeprojBuildSettingsDemo/XcodeprojBuildSettingsDemo.xcodeproj'
p = Xcodeproj::Project.open(path)
t = p.targets.first
bc = t.build_configurations[1]
bs = bc.resolve_build_setting('PROVISIONING_PROFILE_SPECIFIER')
puts bs
# Output:
# $(COM_RELEASE_PROVISIONING_PROFILE_SPECIFIER_PROD)Metadata
Metadata
Assignees
Labels
No labels