In all my iOS projects I use and strongly prefer Carthage. It is easy to use, does not do any changes to your project, all the dependencies are built just once and then linked to the project as dynamic frameworks. There are many good posts about the advantages of Carthage compared to CocoaPods so in this post I will just focus on the actual usage, mainly in CI.
All your Carthage dependencies are listed in the
Cartfile file in the root of your project. In case you split your app into multiple projects like I do, there is a
Cartfile for every project in the workspace. Next to every
Cartfile there is a
Cartfile.resolved file pinning all your dependencies to a specific version.
You just need to keep those two files in your source control and then run
carthage bootstrap when you clone the project so Carthage downloads and builds all the dependencies. This happens just once for a developer, but it is slow and time consuming. If you use a CI for automatic builds, it becomes a real time waste rebuilding all the dependencies before each build.
Developers typically try to speed things up with multiple approaches
Carthage/Checkoutsin source control. This makes the repository bigger by keeping unnecessary files, the checkout is faster but the build is still slow.
Carthage/Buildin source control. This also makes the repository bigger, potentially much bigger if you update your dependencies often, but the build times are super fast as there is nothing to actually build.
- Caching the Carthage builds in CI. This does not make the repository bigger and can be really fast when done properly
- Caching the Carthage builds using tools like Rome. This does not make the repository bigger and can be very powerful and flexible, but typically requires a paid 3rd party storage service like Amazon S3.