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

Already on GitHub? Sign in to your account

Support default_subspec for nested subspecs #1021

Closed
rosskimes opened this Issue May 3, 2013 · 6 comments

Comments

Projects
None yet
4 participants

It seems that default_subspec currently only works for top level subspecs. It would be useful if it worked for nested subspecs as well.

Example

Pod::Spec.new do |s|
    s.name = 'Root'

    s.subspec 'Sub_1' do |sub1|

        sub1.default_subspec = 'Sub_1a'

        sp.subspec 'Sub_1a' do |sub1a|
        end

        sp.subspec 'Sub_1b' do |sub1b|
        end
    end

    s.subspec 'Sub2' do |sub2|

        sub2.default_subspec = 'Sub_2a'

        sp.subspec 'Sub_2a' do |sub2a|
        end

        sp.subspec 'Sub_2b' do |sub2b|
        end
    end

end

The expected behavior of this would be that pod "Root" would include Sub_1a and Sub_2a.

Owner

fabiopelosin commented May 4, 2013

If this is the case, this would be a bug.

The expected behavior of this would be that pod "Root" would include Sub_1a and Sub_2a.

What happens instead? If you remove the preferred dependency do you get everything properly installed? Moreover, now that I think about it, you might need to specify the full name of the subspec (like Root\Sub2\Sub_2a).

I can't test it over the weekend (don't have access to the repo I have it set up on from home). I'll try the full repo name tomorrow morning and post an update here.

Looks like it is a bug. If I do sub1.default_subspec = 'Sub_1a' I get

[!] Unable to find a specification named `Root/Sub_1/Sub_1a` in `Root/Sub_1 (1.0)`.

If I do sub1.default_subspec = 'Sub_1/Sub_1a'

[!] Unable to find a specification named `Root/Sub_1/Sub_1/Sub_1a` in `Root/Sub_1 (1.0)`.

If I do sub1.default_subspec = 'Root/Sub_1/Sub_1a'

[!] Unable to find a specification named `Root/Sub_1/Root/Sub_1/Sub_1a` in `Root/Sub_1 (1.0)`.
Owner

fabiopelosin commented May 6, 2013

Thanks!

@fabiopelosin fabiopelosin was assigned May 9, 2013

Just ran into this myself. Confirmed that default_subspec for subspecs throws an error, even if it's moved below defined subspecs.

Owner

alloy commented Aug 23, 2013

A patch would be much appreciated, fellows.

@jzapater jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013

@keith keith Merge pull request #1021 from cbess/cbintrospect
[New Pod] CBIntrospect
371d194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment