Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Bazaar] Add Bazaar support #1632

Merged
merged 8 commits into from

5 participants

@fmccann

I wasn't able to sort out my previous repository / pull request. I'm not sure what happened, but I couldn't get it passing tests nor could I get it to cleanly rebase. I've manually added the changes to a clean clone of master and I've made sure all the tests pass and it works with Travis CI.

@Kapin
Collaborator

:+1:

@alloy alloy commented on the diff
.travis.yml
((8 lines not shown))
before_install:
- - sh -c 'if [ "$RVM_RUBY_VERSION" != "system" ]; then rvm install $RVM_RUBY_VERSION; fi'
+ - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
+ - sh -c 'if [ "$RVM_RUBY_VERSION" != "system" ]; then rvm install $RVM_RUBY_VERSION --without-tcl --without-tk; fi'
@alloy Owner
alloy added a note

Good catch, we don’t need those tcl/tk extensions.

@fabiopelosin Owner

:+1:

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

@fmccann Awesome work, thanks again!

@alloy alloy merged commit 730d33a into CocoaPods:master

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 119 additions and 5 deletions.
  1. +5 −3 .travis.yml
  2. +5 −1 CHANGELOG.md
  3. +1 −1  lib/cocoapods/command/spec.rb
  4. +30 −0 lib/cocoapods/external_sources.rb
  5. +3 −0  spec/fixtures/bzr-repo/.bzr/README
  6. +1 −0  spec/fixtures/bzr-repo/.bzr/branch-format
  7. 0  spec/fixtures/bzr-repo/.bzr/branch/branch.conf
  8. +1 −0  spec/fixtures/bzr-repo/.bzr/branch/format
  9. +1 −0  spec/fixtures/bzr-repo/.bzr/branch/last-revision
  10. 0  spec/fixtures/bzr-repo/.bzr/branch/tags
  11. +1 −0  spec/fixtures/bzr-repo/.bzr/checkout/conflicts
  12. BIN  spec/fixtures/bzr-repo/.bzr/checkout/dirstate
  13. +1 −0  spec/fixtures/bzr-repo/.bzr/checkout/format
  14. 0  spec/fixtures/bzr-repo/.bzr/checkout/views
  15. +1 −0  spec/fixtures/bzr-repo/.bzr/repository/format
  16. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.cix
  17. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.iix
  18. +8 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.rix
  19. +5 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.six
  20. +8 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.tix
  21. +7 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.cix
  22. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.iix
  23. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.rix
  24. +5 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.six
  25. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.tix
  26. BIN  spec/fixtures/bzr-repo/.bzr/repository/pack-names
  27. BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/5b3f31ef63699074fdad6fa3b0e55305.pack
  28. BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/c70a743dc767dc376699c48c5e9cf925.pack
  29. +10 −0 spec/fixtures/bzr-repo/BazaarSource.podspec
  30. +1 −0  spec/fixtures/bzr-repo/README
  31. +25 −0 spec/unit/external_sources_spec.rb
View
8 .travis.yml
@@ -1,11 +1,13 @@
language: objective-c
env:
# This is what 10.8.x comes with and we want to support that.
- - RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com
- - RVM_RUBY_VERSION=1.8.7-p358 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2 && curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com
+ - RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
+ - RVM_RUBY_VERSION=1.8.7-p358 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
before_install:
- - sh -c 'if [ "$RVM_RUBY_VERSION" != "system" ]; then rvm install $RVM_RUBY_VERSION; fi'
+ - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
+ - sh -c 'if [ "$RVM_RUBY_VERSION" != "system" ]; then rvm install $RVM_RUBY_VERSION --without-tcl --without-tk; fi'
@alloy Owner
alloy added a note

Good catch, we don’t need those tcl/tk extensions.

@fabiopelosin Owner

:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
- source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
+ - brew update && brew install bzr
install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap[use_bundle_dir]
script: bundle exec rake spec:ci
notifications:
View
6 CHANGELOG.md
@@ -16,6 +16,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
* Support LZMA2 compressed tarballs in the downloader
[Kyle Fuller](https://github.com/kylef)
[cocoapods-downloader#5](https://github.com/CocoaPods/cocoapods-downloader/pull/5)
+
+* Add Bazaar support for installing directly from a repo
+ [Fred McCann](https://github.com/fmccann)
+ [#1632](https://github.com/CocoaPods/CocoaPods/pull/1632)
###### Bug Fixes
@@ -28,7 +32,7 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
`$(SDKROOT)/Developer/Library/Frameworks` is used for iOS and
`$(DEVELOPER_LIBRARY_DIR)/Frameworks` is used for OS X
[Kevin Wales](https://github.com/kwales)
- [#1562](https://github.com/CocoaPods/pull/1562)
+ [#1562](https://github.com/CocoaPods/CocoaPods/pull/1562)
* When updating the pod repos, repositories with unreachable remotes
are now ignored. This fixes an issue with certain private repositories.
View
2  lib/cocoapods/command/spec.rb
@@ -512,7 +512,7 @@ def spec_template(data)
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the location from where the source should be retrieved.
- # Supports git, hg, svn and HTTP.
+ # Supports git, hg, bzr, svn and HTTP.
#
s.source = { :git => "#{data[:source_url]}", #{data[:ref_type]} => "#{data[:ref]}" }
View
30 lib/cocoapods/external_sources.rb
@@ -16,6 +16,7 @@ def self.from_dependency(dependency, podfile_path)
klass = if params.key?(:git) then GitSource
elsif params.key?(:svn) then SvnSource
elsif params.key?(:hg) then MercurialSource
+ elsif params.key?(:bzr) then BazaarSource
elsif params.key?(:podspec) then PodspecSource
elsif params.key?(:path) then PathSource
end
@@ -261,6 +262,35 @@ def description
#-------------------------------------------------------------------------#
+ # Provides support for fetching a specification file from a Bazaar
+ # source remote.
+ #
+ # Supports all the options of the downloader (is similar to the git key of
+ # `source` attribute of a specification).
+ #
+ # @note The podspec must be in the root of the repository and should have a
+ # name matching the one of the dependency.
+ #
+ class BazaarSource < AbstractExternalSource
+
+ # @see AbstractExternalSource#fetch
+ #
+ def fetch(sandbox)
+ pre_download(sandbox)
+ end
+
+ # @see AbstractExternalSource#description
+ #
+ def description
+ "from `#{params[:bzr]}`".tap do |description|
+ description << ", tag `#{params[:tag]}`" if params[:tag]
+ description << ", revision `#{params[:revision]}`" if params[:revision]
+ end
+ end
+ end
+
+ #-------------------------------------------------------------------------#
+
# Provides support for fetching a specification file from an URL. Can be
# http, file, etc.
#
View
3  spec/fixtures/bzr-repo/.bzr/README
@@ -0,0 +1,3 @@
+This is a Bazaar control directory.
+Do not change any files in this directory.
+See http://bazaar.canonical.com/ for more information about Bazaar.
View
1  spec/fixtures/bzr-repo/.bzr/branch-format
@@ -0,0 +1 @@
+Bazaar-NG meta directory, format 1
View
0  spec/fixtures/bzr-repo/.bzr/branch/branch.conf
No changes.
View
1  spec/fixtures/bzr-repo/.bzr/branch/format
@@ -0,0 +1 @@
+Bazaar Branch Format 7 (needs bzr 1.6)
View
1  spec/fixtures/bzr-repo/.bzr/branch/last-revision
@@ -0,0 +1 @@
+2 fred@sharpnoodles.com-20131030202140-gg5dfrrtaotfxlrh
View
0  spec/fixtures/bzr-repo/.bzr/branch/tags
No changes.
View
1  spec/fixtures/bzr-repo/.bzr/checkout/conflicts
@@ -0,0 +1 @@
+BZR conflict list format 1
View
BIN  spec/fixtures/bzr-repo/.bzr/checkout/dirstate
Binary file not shown
View
1  spec/fixtures/bzr-repo/.bzr/checkout/format
@@ -0,0 +1 @@
+Bazaar Working Tree Format 6 (bzr 1.14)
View
0  spec/fixtures/bzr-repo/.bzr/checkout/views
No changes.
View
1  spec/fixtures/bzr-repo/.bzr/repository/format
@@ -0,0 +1 @@
+Bazaar repository format 2a (needs bzr 1.16 or later)
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.cix
Binary file not shown
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.iix
Binary file not shown
View
8 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.rix
@@ -0,0 +1,8 @@
+B+Tree Graph Index 2
+node_ref_lists=1
+key_elements=1
+len=1
+row_lengths=1
+x��Q
+� �;�0޺�tK-�R4�n���?'oC�wK;l-W�.�6l�
+���"��ǰ�^c��:��BMF@��,B
View
5 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.six
@@ -0,0 +1,5 @@
+B+Tree Graph Index 2
+node_ref_lists=0
+key_elements=1
+len=0
+row_lengths=
View
8 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.tix
@@ -0,0 +1,8 @@
+B+Tree Graph Index 2
+node_ref_lists=1
+key_elements=2
+len=3
+row_lengths=1
+x���M�0@a֜� �Lg ԅ�71�P,�ȏ��-+���M� W'ܦ5�C��H>xi�& ��(�"ü��k��A� bo��ax{o�ļ��#P�B][��а^��IR`�2�
+4i�����,FE�;;��t
+"���t�J57�s�L :*��7�}�v�� e�
View
7 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.cix
@@ -0,0 +1,7 @@
+B+Tree Graph Index 2
+node_ref_lists=0
+key_elements=1
+len=1
+row_lengths=1
+x��� � P�L�Z
+��8�'@8x0ы������&V|6�H�����cr7e�yhZC��b����r"&s�?�-
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.iix
Binary file not shown
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.rix
Binary file not shown
View
5 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.six
@@ -0,0 +1,5 @@
+B+Tree Graph Index 2
+node_ref_lists=0
+key_elements=1
+len=0
+row_lengths=
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.tix
Binary file not shown
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/pack-names
Binary file not shown
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/5b3f31ef63699074fdad6fa3b0e55305.pack
Binary file not shown
View
BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/c70a743dc767dc376699c48c5e9cf925.pack
Binary file not shown
View
10 spec/fixtures/bzr-repo/BazaarSource.podspec
@@ -0,0 +1,10 @@
+Pod::Spec.new do |s|
+ s.name = "BazaarSource"
+ s.version = "0.0.1"
+ s.summary = "A short description of BazaarSource."
+ s.homepage = "http://EXAMPLE/BazaarSource"
+ s.license = 'MIT (example)'
+ s.author = { "Fred McCann" => "fred@sharpnoodles.com" }
+ s.source = { :git => "http://EXAMPLE/BazaarSource.git", :tag => "0.0.1" }
+ s.source_files = 'Classes', 'Classes/**/*.{h,m}'
+end
View
1  spec/fixtures/bzr-repo/README
@@ -0,0 +1 @@
+second commit
View
25 spec/unit/external_sources_spec.rb
@@ -148,6 +148,31 @@ module Pod
#---------------------------------------------------------------------------#
+ describe ExternalSources::BazaarSource do
+
+ before do
+ dependency = Dependency.new("BazaarSource", :bzr => fixture('bzr-repo'))
+ @external_source = ExternalSources.from_dependency(dependency, nil)
+ end
+
+ it "creates a copy of the podspec" do
+ @external_source.fetch(config.sandbox)
+ path = config.sandbox.root + 'Local Podspecs/BazaarSource.podspec'
+ path.should.exist?
+ end
+
+ it "marks a LocalPod as downloaded" do
+ @external_source.fetch(config.sandbox)
+ config.sandbox.predownloaded_pods.should == ["BazaarSource"]
+ end
+
+ it "returns the description" do
+ @external_source.description.should.match %r|from `.*/bzr-repo`|
+ end
+ end
+
+ #---------------------------------------------------------------------------#
+
describe ExternalSources::PodspecSource do
before do
Something went wrong with that request. Please try again.