Separate Carthage optional dependencies#635
Conversation
|
@manicmaniac What happens when you try to build on an empty Carthage project here - does it only build the |
|
@designatednerd In fact, frameworks can be built individually even without building their dependencies (they are only needed at the time they are linked into an executable). I have created the example repository including an empty iOS project and Cartfile. And the result is that both of them succeeded in building dependencies. Unfortunately I wrote the project filename incorrectly so the main unit test was broken... but I'm pretty sure it doesn't affect the conclusion. |
|
Welp, thanks for helping me figure out I needed to do #639. 🙃 Once that gets merged I'll try installing via Carthage again with this to see what I can figure out. |
|
@manicmaniac Can you please pull in the changes from |
68a464d to
944bb2a
Compare
designatednerd
left a comment
There was a problem hiding this comment.
This works, I will update the Carthage installation docs in a separate PR.
Problem
When I install
apollo-iosfrom Carthage, it always builds unnecessary optional dependencies likeSQLite.swiftandStarscream.Building unused dependencies is not only a waste of time, but also it might lead a conflict with the version of user's dependency.
In fact, the current version designation is too strict for those who want to use
SQLite.swiftorStarscreamitself.https://github.com/apollographql/apollo-ios/blob/3a91bee6be5c4c42e35a8e372d9645f06b439b93/Cartfile
I think the most of users of
apollo-iosdon't always use both of websocket and SQLite features.Thus it shouldn't depend on them by default and only users have the right to decide whether to use the feature or not or which version to use.
Currently
apollo-ios's Podfile resolves this problem by using subspec feature.Cause
Since Carthage resolves dependency graph by parsing Cartfile, including optional dependencies into Cartfile causes this kind of problem.
Fortunately, Carthage has the neat solution:
Cartfile.private.Solution
Renamed Cartfile to Cartfile.private to make dependencies optional.