In almost every project that I create, I bring in frameworks and libraries. After trying a number of different approaches to make this easier, I have landed on a system that uses Carthage, and Git submodules. The system basically comes from a post by Bart Whiteley, but I wanted to record all of the steps so that I have them in one place for my own reference.
The advantage of this system that you have all the control of submodules, while having the ease of using Carthage to keep dependencies in sync. You can easily change the version number of the dependencies in Carthage, and then commit the update to the submodule, making it easy to work across teams.
carthage bootstrap --no-build --use-submodules.
bootstraponce in your project. After that, you will run
carthage update --no-build --use-submodules.
PBXFileReferencesection, find the entry for your framework.
pathproperty to be simply
FrameworkName.framework. You will probably be removing a long, absolute path reference.
sourceTreeproperty should be set to
When someone else checks out the project, it is not necessary to run any
carthage commands. Instead, they will update the submodules. This can be done in Terminal, if needed, using
git submodule update --init.
It is always a challenge to find the best way to incorporate third-party code in a consistent, repeatable way that works well for individual developers as well as automated build systems. This has worked well for us, and hopefully will help you and your team as well.