Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List all desired subspecs on one line in Podfile #221

Closed
mickeyreiss opened this issue Feb 26, 2015 · 6 comments · Fixed by #234
Closed

List all desired subspecs on one line in Podfile #221

mickeyreiss opened this issue Feb 26, 2015 · 6 comments · Fixed by #234
Assignees

Comments

@mickeyreiss
Copy link

Similar to #150, I am also hitting a point where some sugar on top of subspecs would be useful.

In my case, I'd like to have a single Pod with ~5 optional subcomponents. Each user of the pod is likely to choose a different subset; it's nearly impossible to determine what the right set of defaults should be. By choosing a subset for people, we likely introduce bloat into typical integrators' apps.

In this type of setup, where subspecs are closer to build variants than separate components, I propose a syntax that allows the user to specify all relevant subspecs on one line in their Podfile:

pod "CuttingTools", :subspecs => ["Scissors", "Machette", "Penknife", "KnifeBlock"]

as an alternative to

pod "CuttingTools/Scissors"
pod "CuttingTools/Machette"
pod "CuttingTools/Penknife"
pod "CuttingTools/KnifeBlock"

You'll note in this example that KnifeBlock has a hierarchical relationship with the rest of the subspecs, in that it holds whichever knives happen to be available; at the same time, if KnifeBlock pulls in every tool (subspec) available as a dependency, many users will end up with extra code provided by the unused katana, butter-knife, etc. (i.e. undesired subspecs for that application).

Has something along these lines been considered in the past?

@segiddins
Copy link
Member

We'd actually rather encourage people to not use subspecs :)

@mickeyreiss
Copy link
Author

What would you suggest as an alternative for situations like this?

@segiddins
Copy link
Member

Runtime customization?

-Samuel E. Giddins

On Feb 25, 2015, at 8:25 PM, Mickey Reiss notifications@github.com wrote:

What would you suggest as an alternative for situations like this?


Reply to this email directly or view it on GitHub.

@kylef
Copy link
Contributor

kylef commented Feb 26, 2015

Since this is Ruby and it's a full language, a short term solution for this that you can currently use with CocoaPods:

%w(Scissors Machette).each{ |s| pod "CuttingTools/#{s}" }

Perhaps the proposed syntax, or a similar syntax makes sense to simplify subspec use. @orta any input?

@segiddins
Copy link
Member

@orta do we want to add this to the DSL?

@orta
Copy link
Member

orta commented Mar 31, 2015

Oh wow, I have never even thought of this. It'd be lovely IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants