jo1087
jo1087

Reputation: 43

What to do if a library you want to use doesn't support Carthage yet

I'm in the middle of assessing whether Carthage would be a good fit for my project and one of the questions I want to find out answers for is what to do when a library/framework I want to use doesn't have support for Carthage yet.

Have any of you had this issue and found a solution for it before?

Thanks

Upvotes: 2

Views: 946

Answers (1)

Tom Kidd
Tom Kidd

Reputation: 12908

The main thing that Carthage needs is a Framework and for that Framework's scheme to be a "shared" scheme.

So one way to get a project to support Carthage is to fork it on GitHub and then share the scheme in Xcode and check that into your fork, then use that fork's address in your Cartfile. If you're successful at this then maybe do a Pull Request with the author of the original so your Carthage support can be grafted back into the main repository.

If the project you're wanting to use doesn't use a Framework, then you have some more work to do since the project will need refactoring but it's possible. Here's an old PDF viewer project and the Carthage support someone grafted into a fork by refactoring things into a Framework (there was some reason it wasn't accepted as a PR and now the main repo is deprecated but it'll give you some idea of what's expected)

Upvotes: 3

Related Questions