'Load different xcconfig file depending on building taget
I have a project with two targets and an app extension which should be included in both of them. In order to avoid duplicating the app extension, I'm trying to use the xcconfig files to define the right bundle identifier and the signing parameters to the extension depending on the target that's currently built. I currently defined two xcconfig files with the following content:
PRODUCT_BUNDLE_IDENTIFIER = ... // Bundle ID
DEVELOPMENT_TEAM = ... // Team ID
CODE_SIGN_IDENTITY = ... // Certificate SHA-1
PROVISIONING_PROFILE_SPECIFIER = ... // Profile UUID
I almost got the job done, but there's one problem. I defined an xcconfig file for the app extension, which is signed manually:
#include "../Project/Resources/Target1-Config.xcconfig"
#include "../Project/Resources/Target2-Config.xcconfig"
PRODUCT_BUNDLE_IDENTIFIER = $(inherited).AppExtensionIdentifier
DEVELOPMENT_TEAM = $(inherited)
CODE_SIGN_IDENTITY = $(inherited)
PROVISIONING_PROFILE_SPECIFIER = $(inherited)
The problem is that the first configuration is overwritten by the second. How can I tell Xcode to pick the right configuration based on the currently selected target to build?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
