Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Subspecs are not recognised when coming from an external spec #638

Closed
hartbit opened this Issue · 4 comments

2 participants

@hartbit

I tried to change the cocos2d 1.1 spec to include a sub spec. To test it, I tried using it in a test project, linking to the modified podspec in a gist. But that did not work. It seems that subspecs are not recognised when linked as an external podspec. @alloy helped me understand the problem and asked me to post this issue.

For reference, here is the podspec I was trying to get working:

Pod::Spec.new do |s|
  s.name         =  'cocos2d'
  s.license      =  { :type => 'MIT', :file => 'LICENSE_cocos2d.txt' }
  s.version      =  '1.1.rc0'
  s.summary      =  'cocos2d for iPhone is a framework for building 2D games, demos, and other graphical/interactive applications.'
  s.description  =  'cocos2d for iPhone is a framework for building 2D games, demos, and other graphical/interactive applications for iPod Touch, iPhone, iPad and Mac. It is based on the cocos2d design but instead of using python it, uses objective-c.'
  s.homepage     =  'http://www.cocos2d-iphone.org'
  s.author       =  { 'Ricardo Quesada' => 'ricardoquesada@gmail.com', 'Zynga Inc.' => 'https://zynga.com/' }
  s.source       =  {:git => 'https://github.com/cocos2d/cocos2d-iphone.git', :commit => '7ee5b9abf645c32379a45317986a308204277bb1'}
  s.preferred_dependency = 'cocos2d'

  s.subspec 'cocos2d' do |cc|
    cc.source_files =  'cocos2d/**/*.{h,m,c}'
    cc.frameworks   =  ["CoreGraphics", "OpenGLES", "QuartzCore"]
    cc.library      =  'z'
    cc.resources    =  "Resources/Fonts/fps_images*.png"

    def cc.copy_header_mapping(from)
      from.relative_path_from(Pathname.new('cocos2d'))
    end

    cc.ios.dependency 'FontLabel'
  end

  s.subspec 'CocosDenshion' do |cd|
    cd.source_files =  'CocosDenshion/CocosDenshion/*.{h,m}'
    cd.frameworks   =  ["AVFoundation", "OpenAL", "CoreFoundation", "AudioToolbox", "Foundation"]
  end
end
@fabiopelosin

To test it, I tried using it in a test project, linking to the modified podspec in a gist.

To test a podspec I would suggest to use pod spec lint.

It seems that subspecs are not recognized when linked as an external podspec.

To be clear you mean to say the following doesn't work?

pod 'cocos2d/CocosDenshion', :podspec => 'cocos2d.podspec'
@hartbit

Yes, I mean pod 'cocos2d/CocosDenshion', :podspec => 'cocos2d.podspec' with the podspec linking to a gist URL.

@fabiopelosin
Owner

Is this issue still present with the latests release (0.17.1)?

@fabiopelosin fabiopelosin reopened this
@fabiopelosin
Owner

After some testing it appears that this issue has been fixed by the refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.