Search code examples
ioscocoapodscarthage

How to move from CocoaPods to Carthage?


My project has linked with like 30 different libraries. Very few of them support Carthage.

Do I need to make a branch and make them support Carthage one by one? Is there any better way to do so?


Solution

  • The carthage idea is based on frameworks. So if your dependencies do not support them, carthage is unable to build them for you. Simple as that.

    But: You can use carthage also to manage dependencies only by using the param "--no-build". Then carthage will only fetch the dependencies into your Carthage/Checkouts folder.

    There are some drawbacks:

    • depending on the project you have to add the projects of each dependency to your own project, if the projects only contain a sample app you have to add the code itself
    • if the projects have dependencies itself carthage is only able to find them if there is a cartfile in the projects, as an alternative you may add the dependent projects to your own cartfile to avoid forking them but then you have to update the versions for yourself
    • developers see the code itself while work but they should handle them as read-only
    • ...

    It's possible to use carthage like that, but I wouldn't recommend it. If you need more informations about this solution read here.

    Note: If you fork the projects and make them support carthage the community might be grateful. ;-)