Support JSON podspecs #1485

Closed
bjtitus opened this Issue Oct 17, 2013 · 10 comments

Comments

Projects
None yet
7 participants

bjtitus commented Oct 17, 2013

The cocoacoapods core already supports reading YAML podspecs so it only seems logical that pod install should respect this and allow dependencies with a .podspec.yaml file to be downloaded and installed.

I noticed that there are other bugs (mainly #960) which may be similar to this. It looks like there are several places in the dependency installation process where .podspec is assumed as the file format. I can setup a pull request to fix this soon.

Are there any reasons why this should not be allowed?

Owner

alloy commented Oct 17, 2013

We’re going to support this starting from when we switch to a web service for pushing new specs. Nonetheless, we will need to support it at that time, so a patch is always appreciated :) However, it might be a good idea to wait for @irrationalfab to see if he already has this somewhere.

Owner

fabiopelosin commented Oct 17, 2013

pod install should respect this and allow dependencies with a .podspec.yaml file to be downloaded and installed.

It should work for specs repos, some other parts of CP might need to be updated like the path option. Are you referring to something else?

I can setup a pull request to fix this soon.

This would be awesome! 👍

bjtitus commented Oct 17, 2013

@irrationalfab Ah. I didn't realize that YAML works for the repos already. I tried installing a local .podspec.yaml and ran into issues with it assuming the .podspec extension (wanted to make sure it worked before switching them in our private repo). This solves the problem we had but I can still submit a pull request with changes to support the YAML format locally if that's interesting.

Owner

fabiopelosin commented Oct 17, 2013

@bjtitus The pull request is definitely welcome! I forgot about those assumptions in the rest of CocoaPods.

@bjtitus bjtitus assigned CocoaPodsBot and unassigned CocoaPodsBot Mar 29, 2014

frosty commented Mar 30, 2014

Still an issue. Specifying a particular yaml Podspec from a Podfile (:podspec => 'UIView-Autolayout.podspec.yaml') results in:

Errno::ENOTDIR - Not a directory - /Users/frosty/src/ios/pods-bug-bash/TestProject/UIView-Autolayout.podspec.yaml/RestKit.podspec
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `initialize'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/external_sources.rb:305:in `block in fetch'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:73:in `titled_section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/external_sources.rb:302:in `fetch'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:268:in `block (2 levels) in fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:266:in `each'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:266:in `block in fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:265:in `fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:56:in `analyze'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:173:in `analyze'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:96:in `block in resolve_dependencies'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:95:in `resolve_dependencies'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:88:in `install!'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command/project.rb:68:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:277:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command.rb:51:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/bin/pod:33:in `<top (required)>'
/Users/frosty/.rbenv/versions/2.0.0-p247/bin/pod:23:in `load'
/Users/frosty/.rbenv/versions/2.0.0-p247/bin/pod:23:in `<main>'

Specifying just the current directory (:podspec => '.') results in:

Errno::ENOENT - No such file or directory - /Users/frosty/src/ios/pods-bug-bash/TestProject/RestKit.podspec
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `initialize'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/external_sources.rb:305:in `block in fetch'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:73:in `titled_section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/external_sources.rb:302:in `fetch'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:268:in `block (2 levels) in fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:266:in `each'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:266:in `block in fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:265:in `fetch_external_sources'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer/analyzer.rb:56:in `analyze'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:173:in `analyze'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:96:in `block in resolve_dependencies'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:95:in `resolve_dependencies'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/installer.rb:88:in `install!'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command/project.rb:68:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:277:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/lib/cocoapods/command.rb:51:in `run'
/Users/frosty/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/cocoapods-0.30.0/bin/pod:33:in `<top (required)>'
/Users/frosty/.rbenv/versions/2.0.0-p247/bin/pod:23:in `load'
/Users/frosty/.rbenv/versions/2.0.0-p247/bin/pod:23:in `<main>'

Looks to me as though in both cases, this line is to ultimately to blame - it's looking specifically for a file with the .podspec extension, otherwise it treats the provided path as a directory.

Issue has been confirmed by @frosty

@bjtitus bjtitus assigned CocoaPodsBot and unassigned CocoaPodsBot Mar 30, 2014

@fabiopelosin fabiopelosin changed the title from Support YAML podspecs to Support JSON podspecs Mar 30, 2014

Owner

fabiopelosin commented Mar 30, 2014

Updated the title to reflect the change to JSON

frosty commented Mar 30, 2014

I'm hoping to raise a pull request on this in the next day or so.

bezigon commented Jul 4, 2014

Any progress on this issue? I have problem with local .podspec.json file.

Contributor

kylef commented Jul 8, 2014

@bezigon I just tested this, it works.

pod 'CCLHTTPServer', :podspec => 'CCLHTTPServer.podspec.json'

@kylef kylef closed this Jul 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment