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

[TargetDefinition] Allow specifying multiple subspec dependencies inline #234

Merged
merged 5 commits into from
Apr 7, 2015

Conversation

segiddins
Copy link
Member

Closes #221.

\c @kylef @orta @alloy

@orta
Copy link
Member

orta commented Apr 5, 2015

I am really glad about this, ARAnalytics ( and my upcoming NSURLRequests pod ) will be much nicer.

@segiddins
Copy link
Member Author

I think we might need to document this in the pod method in the DSL as well, but I just threw this together.

##### Enhancements

* Allow specifying multiple subspec pod dependencies inline in the Podfile,
via `pod 'Pod', subspecs: ['Subspec1', 'Subspec2']`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather we use the hash rocket syntax in this CHANGELOG entry, we should stick to a consistent way of doing things in guides/examples etc as to not confuse our users who are not familiar with Ruby.

It might lead to people trying things like this:

pod 'Pod', subspecs: ['Subspec1', 'Subspec2'], :git => 'foo'

@kylef
Copy link
Contributor

kylef commented Apr 5, 2015

Nice work 👍, looks great.

@@ -468,6 +468,7 @@ def set_platform(name, target = nil)
# @return [void]
#
def store_pod(name, *requirements)
parse_subspecs(name, requirements) # This parse method must be called first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that comment really needed? Won’t the tests indicate that this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not 100% needed, but I feel it's better to write it down than make someone chase thru the tests next time around. The tests describe the desired end effect, the comment addresses the why.

@alloy
Copy link
Member

alloy commented Apr 5, 2015

Nice 👍

@@ -44,6 +44,33 @@ module Pod
target.pod_whitelisted_for_configuration?('PonyDebugger', 'Debug').should.be.false
end

it 'allows specifying multiple additional subspecs' do
podfile = Podfile.new do
pod 'RestKit', '~> 0.24.0', :subspecs => %w(CoreData Networking), :configurations => %w(Release)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this implementation, this example shows that the root spec is also included.

pod 'RestKit', :subspecs => %w(CoreData Networking)

Expands into:

  • RestKit
  • RestKit/CoreData
  • RestKit/Networking

I'm not sure if it makes sense to include the root spec when using :subspecs since by default, the root spec should make the full library available unless their is alternative incompatible subspecs.

This means that this actually has no benefits for pods such as ARAnalytics since:

pod 'ARAnaytics', :subspecs => ['Crashlytics', 'Mixpanel']

Would actually install all the subspecs since all the default_subspecs from ARAnalytics is included (which is all of them if i'm not mistaken).

I've created a PR #236 to change it's behaviour.

@segiddins
Copy link
Member Author

Let's 🚢 ?

kylef added a commit that referenced this pull request Apr 7, 2015
[TargetDefinition] Allow specifying multiple subspec dependencies inline
@kylef kylef merged commit 7dcd237 into master Apr 7, 2015
@kylef kylef deleted the seg-inline-subspec-dependencies branch April 7, 2015 22:39
@kylef
Copy link
Contributor

kylef commented Apr 7, 2015

🚢-ed

Ashton-W pushed a commit to Ashton-W/Core that referenced this pull request Nov 2, 2015
…pendencies

[TargetDefinition] Allow specifying multiple subspec dependencies inline
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 this pull request may close these issues.

List all desired subspecs on one line in Podfile
4 participants