Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the equivalent of "development pods" under Carthage?

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?

like image 575
Brian Kendig Avatar asked Jul 12 '17 20:07

Brian Kendig


People also ask

What is the difference between Carthage and CocoaPods?

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.

What is Dev pod?

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.

What is Cartfile resolved?

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.

How do you update Carthage dependencies?

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.


1 Answers

I believe Carthage doesn't have something similar to "development pods" yet.

But you could simulate "development pods" just following these steps:

Steps:

  1. Add the .xcodeproj to your workspace
  2. Remove all the dependencies you have in your project of the framework you added in step 1. (probably you may need to remove it from Build Phases -> Run Script -> Input Files too )
  3. Go to 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)
  4. (optional) you may need to run 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.

like image 184
Gabriel Goncalves Avatar answered Nov 09 '22 08:11

Gabriel Goncalves