Separate Carthage optional dependencies #635
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When I install
apollo-ios
from Carthage, it always builds unnecessary optional dependencies likeSQLite.swift
andStarscream
.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.swift
orStarscream
itself.https://github.com/apollographql/apollo-ios/blob/3a91bee6be5c4c42e35a8e372d9645f06b439b93/Cartfile
I think the most of users of
apollo-ios
don'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.