Sub-project Headers vs. Custom Build Configuration Woes
Sub-project Headers vs. Custom Build Configuration Woes
- Subject: Sub-project Headers vs. Custom Build Configuration Woes
- From: Karl Moskowski <email@hidden>
- Date: Tue, 17 Dec 2013 09:04:15 -0500
In my OS X project (Xcode 5.0.2 hosted on Mavericks, 10.9 SDK) I use the HockeySDK, integrated as a git submodule.
I build the framework using the tried-and-true approach for embedded frameworks:
1. Drag HockeySDK.xcodeproj into my project.
2. Add its HockeySDK.framework target to my app target's dependencies.
2. Add HockeySDK.framework target to my app target's Link Binary with Libraries build phase.
3. Add HockeySDK.framework to a Copy Files to Frameworks build phase.
4. Add a shell script build phase to codesign the embedded framework.
Then I added a User-Defined Setting to my app target to set the base URL of my API server which is pre-processed into the app's Info.plist.
It builds and runs with the Debug configuration, and it archives successfully with the Release configuration.
Now I want to add other build configurations so I can, e.g., run a Debug version of the app against our production server, or Archive a beta version against the staging server for our testers. I copied the two standard configurations to get:
1. Debug
2. Debug with Staging API (a copy of Debug)
3. Debug with Production API (a copy of Debug)
4. Distribution with Development API (a copy of Release)
5. Distribution with Staging API (a copy of Release)
6. Distribution with Production API (a copy of Release)
7. Release
The problem is this: when I try to Build for Running with the scheme set to use one my Debug copies, or when I try to Archive with one of the Release copies, the build fails because it can't find HockeySDK.h. I think it's because the HockeySDK project only includes the standard Debug and Release configurations, and anything other than Debug builds into a Release directory.
I tried setting my project's Framework Search Paths setting to "$(TARGET_BUILD_DIR)/../Release", per a suggestion from a HockeySDK developer <http://support.hockeyapp.net/discussions/problems/17050-import-hockeysdkhockeysdkh-not-found-on-os-x>. That fixed building with the Debug copies, but Archiving still fails. I've so far been unable to find a suitable Framework Search Paths setting for that case.
There are a few workarounds, but they're sub-optimal IMO:
1. Get rid of the sub-project approach altogether and build a release version of the framework manually, then copy it into the project and add build phases to copy it to the built app.
2. Use a fork of the sub-project with configurations added to match the app.
3. Get rid of the custom build configurations and manually edit the build settings appropriately for each release.
Is there a build setting I could use in Framework Search Paths to make it just work?
Thanks.
----
Karl Moskowski <email@hidden>
<http://about.me/kolpanic>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden