The teams developing frameworks for our iOS app are migrating from Cocoapods to Carthage.
Under Cocoapods, I could set up dependencies as "development pods". For example, instead of having the main app download a specific version of an xyzzy
dependency, I could set up xyzzy
as a development pod and point it to my local directory where I had checked out xyzzy
from its Git repo. While I was working in the main app's project, any edits I'd do to xyzzy
's files would be made in that directory. This let me build and test changes immediately, and when I was ready to check them in, Git would find them in the xyzzy
project's directory.
Under Carthage I haven't found a way to do this. I see http://allocinit.io/ios/debugging-carthage-dependencies/ which explains how to create symbolic links so that I can see the dependency source files to make debugging easier, but any edits I make to them are under the main application's Carthage/Builds
directory.
How do I set up the equivalent of development pods under Carthage?
Carthage and CocoaPods are very different in terms of building the dependencies and integrating them in the project. CocoaPods is centralized dependency manager and it will build your dependencies and integrate them directly in the project by creating new . xcworkspace workspace.
Development Pods are different from normal CocoaPods in that they are symlinked files, so making edits to them will change the original files, so you can work on your library from inside Xcode. Your demo & tests will need to include references to headers using the #import <MyLib/XYZ.h> format.
The most important of these is the Cartfile. resolved file, which lists the versions that were actually built for each framework. Make sure to commit your Cartfile. resolved, because anyone else using the project will need that file to build the same framework versions.
If you've modified your Cartfile, or you want to update to the newest versions of each framework (subject to the requirements you've specified), simply run the carthage update command again. If you only want to update one, or specific, dependencies, pass them as a space-separated list to the update command.
I believe Carthage doesn't have something similar to "development pods" yet.
But you could simulate "development pods" just following these steps:
Steps:
Build Phases -> Run Script -> Input Files
too )General
tab of the target you want to run, add the framework under Linked Frameworks and Libraries
(it is going to take the one added from the .xcoproj)carthage bootstrap
in the framework's repo you want to add locally.That's it.
After that you will be able to run your project and update framework's code in the same workspace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With