Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Bazaar] Add Bazaar support #1579

Closed
wants to merge 3 commits into from

5 participants

@fmccann

This is the same changes from my original pull request (#1531) with the noisy travis-ci commits squashed into a single commit. I suggest we abandon the bar branch and pull from this one.

@coveralls

Coverage Status

Coverage increased (+0.13%) when pulling 9576984 on fmccann:bzr2 into aa25ac0 on CocoaPods:master.

@alloy alloy commented on the diff
.travis.yml
((6 lines not shown))
- source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
+ - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem && export SSL_CERT_FILE=/usr/local/share/cacert.pem && export PYTHONPATH=/usr/local/lib/python2.7/site-packages && brew update && brew install bzr
@alloy Owner
alloy added a note

If we’re going to fetch the CA certs and export them for every test run anyways, then it’s best to remove it from the second RUBY_VERSION_SPECIFIC var above so that it’s only done once per test run.

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

It’s almost ready to be merged, but could you please add a CHANGELOG entry crediting yourself first?

@fabiopelosin

Ah true, I forgot about the changelog!

@fabiopelosin

Eloy, any suggestion about the failures of this patch only on one build?

NoMethodError: undefined method `write_plist' for Xcodeproj:Module
@alloy
Owner

@irrationalfab I don’t see any output that it’s using the precompiled extension, but it’s the only thing I can imagine.

As you can see from the paths, it has installed the gem with Ruby 1.8.x:

/Users/travis/build/CocoaPods/CocoaPods/travis_bundle_dir/ruby/1.8/bundler/gems/Xcodeproj-ceae7a7be45e/lib/xcodeproj/project.rb:303:in `save': In general - adds the Pods project to the workspace

But RVM is actually using 1.9.3. This is not what we wanted at all when we say ‘use system’. In that case we want the system ruby, which is 1.8.7.

I don’t have time atm to look into this, if you do, please investigate this.

/cc @henrikhodne

@fabiopelosin

@alloy As you say it appears that system Ruby is resolving to 1.9.3 which should never be the case. At the moment, the only explanation that I have is misconfiguration in Travis.

@fabiopelosin

Ok, the tests where a temporary issue. @fmccann Can you add a note to the changelog?

@fmccann
@alloy
Owner

@fmccann To the current ‘Master’ section.

@orta
Owner

This looks good, but looks like it needs a rebase :+1:

@fmccann
@fmccann fmccann closed this
@fmccann fmccann deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2013
  1. @fmccann

    [Bazaar] Add Bazaar support

    fmccann authored
Commits on Nov 15, 2013
  1. @fmccann
  2. @fmccann
This page is out of date. Refresh to see the latest.
Showing with 119 additions and 4 deletions.
  1. +2 −1  .travis.yml
  2. +7 −1 CHANGELOG.md
  3. +1 −1  lib/cocoapods/command/spec.rb
  4. +30 −0 lib/cocoapods/external_sources.rb
  5. +1 −1  spec/cocoapods-integration-specs
  6. +3 −0  spec/fixtures/bzr-repo/.bzr/README
  7. +1 −0  spec/fixtures/bzr-repo/.bzr/branch-format
  8. 0  spec/fixtures/bzr-repo/.bzr/branch/branch.conf
  9. +1 −0  spec/fixtures/bzr-repo/.bzr/branch/format
  10. +1 −0  spec/fixtures/bzr-repo/.bzr/branch/last-revision
  11. 0  spec/fixtures/bzr-repo/.bzr/branch/tags
  12. +1 −0  spec/fixtures/bzr-repo/.bzr/checkout/conflicts
  13. BIN  spec/fixtures/bzr-repo/.bzr/checkout/dirstate
  14. +1 −0  spec/fixtures/bzr-repo/.bzr/checkout/format
  15. 0  spec/fixtures/bzr-repo/.bzr/checkout/views
  16. +1 −0  spec/fixtures/bzr-repo/.bzr/repository/format
  17. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.cix
  18. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.iix
  19. +8 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.rix
  20. +5 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.six
  21. +8 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/5b3f31ef63699074fdad6fa3b0e55305.tix
  22. +7 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.cix
  23. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.iix
  24. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.rix
  25. +5 −0 spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.six
  26. BIN  spec/fixtures/bzr-repo/.bzr/repository/indices/c70a743dc767dc376699c48c5e9cf925.tix
  27. BIN  spec/fixtures/bzr-repo/.bzr/repository/pack-names
  28. BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/5b3f31ef63699074fdad6fa3b0e55305.pack
  29. BIN  spec/fixtures/bzr-repo/.bzr/repository/packs/c70a743dc767dc376699c48c5e9cf925.pack
  30. +10 −0 spec/fixtures/bzr-repo/BazaarSource.podspec
  31. +1 −0  spec/fixtures/bzr-repo/README
  32. +25 −0 spec/unit/external_sources_spec.rb
View
3  .travis.yml
@@ -3,8 +3,9 @@ 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 update --system && sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com
- RVM_RUBY_VERSION=1.9.3-p392 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
-before_install:
+before_install:
- source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
+ - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem && export SSL_CERT_FILE=/usr/local/share/cacert.pem && export PYTHONPATH=/usr/local/lib/python2.7/site-packages && brew update && brew install bzr
@alloy Owner
alloy added a note

If we’re going to fetch the CA certs and export them for every test run anyways, then it’s best to remove it from the second RUBY_VERSION_SPECIFIC var above so that it’s only done once per test run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap[use_bundle_dir]
script: bundle exec rake spec:ci
notifications:
View
8 CHANGELOG.md
@@ -4,13 +4,19 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
## Master
+###### Enhancements
+
+* Add Bazaar support for installing directly from a repo
+ [Fred McCann](https://github.com/fmccann)
+ [#1579](https://github.com/CocoaPods/CocoaPods/pull/1579)
+
###### Bug Fixes
* Fixed the developer frameworks search paths so that
`$(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)
## 0.28.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0)
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.
#
2  spec/cocoapods-integration-specs
@@ -1 +1 @@
-Subproject commit e6127aca6fb1a7387afaa25d38f1caf3640c0876
+Subproject commit 4ae6545aaa358a2ee8efc9b57787f2ac20aed346
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.