Permalink
Browse files

Merge branch 'master' into list-new

* master:
  Added note about set_arc_compatibility_flag to the CHANGELOG
  Looks like the -fobj-arc flag we added to OTHER_LD_FLAGS in ea918cd was an unsupported feature as it has now been removed from Xcode 4.3.2, causing lib tool to complain about an unrecognised flag.
  Instead of removing the VCR cache, namespace the cache by Ruby version.
  Remove Guard dependencies. Use `rake spec:kick` for auto-test-running.
  Make sure to use bundler for rake tasks that run bacon.
  Oops, use correct rake task.
  Move travis install commands to Rakefile and setup CFLAGS env for Travis/RVM.
  Hmm, chicken and egg problem on Travis, copy travis:setup task from Xcodeproj.
  Replace Xcodeproj git submodule by adding it to the Gemfile. Closes #172.
  Improve error report template. Closes #187.

Conflicts:
	.kick
  • Loading branch information...
2 parents 22e342a + 4c0b3f4 commit 8390a901300522d825ccc8c70b5a18fc08016be6 @fabiopelosin fabiopelosin committed Mar 26, 2012
View
@@ -12,7 +12,6 @@ examples/Pods
examples/**/Pods
spec/fixtures/banana-lib
spec/fixtures/integration/Headers/
-pod
/concatenated.*
spec/fixtures/mercurial-repo/.hg/*cache
.hg
View
@@ -10,9 +10,6 @@
[submodule "spec/fixtures/integration/sstoolkit"]
path = spec/fixtures/integration/sstoolkit
url = https://github.com/samsoffes/sstoolkit.git
-[submodule "external/Xcodeproj"]
- path = external/Xcodeproj
- url = https://github.com/CocoaPods/Xcodeproj.git
[submodule "spec/fixtures/spec-repos/master"]
path = spec/fixtures/spec-repos/master
url = https://github.com/CocoaPods/Specs.git
View
12 .kick
@@ -13,6 +13,18 @@ process do |files|
Kicker::Recipes::Ruby.run_tests(specs)
end
+# Have written this so many times, probably should make a recipe out of it.
+process do |files|
+ files.each do |file|
+ case file
+ when 'Gemfile'
+ files.delete(file)
+ execute 'bundle install'
+ end
+ end
+end
+
recipe :ignore
ignore(/.*\/?tags/)
ignore(/.*\/?\.git/)
+
View
@@ -2,5 +2,5 @@ language: ruby
rvm:
- 1.8.7
- 1.9.3
-before_install: git submodule update --init && cd external/Xcodeproj && rake travis:setup && sudo apt-get install subversion
-script: cd ../.. && bundle exec rake spec
+install: rake travis:setup
+script: bundle exec rake spec
View
@@ -74,6 +74,12 @@ podspec, then update these method calls.
### Fixes
+* [#142](https://github.com/CocoaPods/CocoaPods/issues/142): Xcode 4.3.2 no longer
+ supports passing the -fobj-arc flag to the linker and will fail to build. The
+ addition of this flag was a workaround for a compiler bug in previous versions.
+ This flag is no longer included by default - to keep using this flag, you need to
+ add `set_arc_compatibility_flag!` to your Podfile.
+
* [#183](https://github.com/CocoaPods/CocoaPods/issues/183): Fix for
`.DS_Store` file in `~/.cocoapods` prevents `$ pod install` from running.
View
11 Gemfile
@@ -3,14 +3,13 @@ source "http://rubygems.org"
gem "open4"
group :development do
- gem "rake"
+ gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
+
gem "bacon"
- gem "guard"
- gem "guard-shell"
- gem "rb-fsevent"
- gem "growl"
+ gem "kicker"
gem "mocha-on-bacon"
+ gem "rake"
+ gem "rb-fsevent"
gem "vcr"
gem "webmock"
- gem "kicker"
end
View
@@ -1,14 +1,15 @@
+GIT
+ remote: git://github.com/CocoaPods/Xcodeproj.git
+ revision: 338e4d37f282121754f10f6d169256a57a64860d
+ specs:
+ xcodeproj (0.1.0)
+
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.7)
bacon (1.1.0)
crack (0.3.1)
- growl (1.0.3)
- guard (0.8.8)
- thor (~> 0.14.6)
- guard-shell (0.3.0)
- guard (>= 0.2.0)
kicker (2.5.0)
rb-fsevent
metaclass (0.0.1)
@@ -19,7 +20,6 @@ GEM
open4 (1.3.0)
rake (0.9.2.2)
rb-fsevent (0.9.0)
- thor (0.14.6)
vcr (2.0.0)
webmock (1.8.0)
addressable (>= 2.2.7)
@@ -30,13 +30,11 @@ PLATFORMS
DEPENDENCIES
bacon
- growl
- guard
- guard-shell
kicker
mocha-on-bacon
open4
rake
rb-fsevent
vcr
webmock
+ xcodeproj!
View
@@ -1,15 +0,0 @@
-# A sample Guardfile
-# More info at https://github.com/guard/guard#readme
-
-def run_spec(s)
- `bundle exec bacon #{s}`
-end
-
-# parameters:
-# output => the formatted to use
-# backtrace => number of lines, nil = everything
-guard :shell do
- watch(%r{^lib/cocoapods/(.+)\.rb$}) { |m| run_spec("spec/unit/#{m[1]}_spec.rb") }
- watch(%r{spec/.+\.rb$}) { |s| run_spec(s) }
-end
-
View
@@ -1,3 +1,51 @@
+# Travis support
+def on_rvm?
+ `which ruby`.strip.include?('.rvm')
+end
+
+def rvm_ruby_dir
+ @rvm_ruby_dir ||= File.expand_path('../..', `which ruby`.strip)
+end
+
+namespace :travis do
+ # Used to create the deb package.
+ #
+ # Known to work with opencflite rev 248.
+ task :prepare_deb do
+ sh "sudo apt-get install subversion libicu-dev"
+ sh "svn co https://opencflite.svn.sourceforge.net/svnroot/opencflite/trunk opencflite"
+ sh "cd opencflite && ./configure --target=linux --with-uuid=/usr --with-tz-includes=./include --prefix=/usr/local && make && sudo make install"
+ sh "sudo /sbin/ldconfig"
+ end
+
+ task :install_opencflite_debs do
+ sh "mkdir -p debs"
+ Dir.chdir("debs") do
+ base_url = "https://github.com/downloads/CocoaPods/OpenCFLite"
+ %w{ opencflite1_248-1_i386.deb opencflite-dev_248-1_i386.deb }.each do |deb|
+ sh "wget #{File.join(base_url, deb)}" unless File.exist?(deb)
+ end
+ sh "sudo dpkg -i *.deb"
+ end
+ end
+
+ task :fix_rvm_include_dir do
+ unless File.exist?(File.join(rvm_ruby_dir, 'include'))
+ # Make Ruby headers available, RVM seems to do not create a include dir on 1.8.7, but it does on 1.9.3.
+ sh "mkdir '#{rvm_ruby_dir}/include'"
+ sh "ln -s '#{rvm_ruby_dir}/lib/ruby/1.8/i686-linux' '#{rvm_ruby_dir}/include/ruby'"
+ end
+ end
+
+ task :install do
+ sh "git submodule update --init"
+ sh "sudo apt-get install subversion"
+ sh "env CFLAGS='-I#{rvm_ruby_dir}/include' bundle install"
+ end
+
+ task :setup => [:install_opencflite_debs, :fix_rvm_include_dir, :install]
+end
+
namespace :gem do
def gem_version
require File.join(File.dirname(__FILE__), *%w[lib cocoapods])
@@ -41,42 +89,33 @@ namespace :gem do
end
end
-namespace :ext do
- XCODEPROJ_DIR = "./external/Xcodeproj"
-
- task :clean do
- sh "cd #{XCODEPROJ_DIR} && rake ext:clean"
- end
-
- task :build do
- sh "cd #{XCODEPROJ_DIR} && rake ext:build"
- end
-
- task :cleanbuild => [:clean, :build]
-end
-
namespace :spec do
def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end
+ desc "Automatically run specs for updated files"
+ task :kick do
+ exec "bundle exec kicker -c"
+ end
+
desc "Run the unit specs"
task :unit => :unpack_fixture_tarballs do
- sh "bacon #{specs('unit/**')} -q"
+ sh "bundle exec bacon #{specs('unit/**')} -q"
end
desc "Run the functional specs"
- task :functional => :clean_env do
- sh "bacon #{specs('functional/**')}"
+ task :functional => :unpack_fixture_tarballs do
+ sh "bundle exec bacon #{specs('functional/**')}"
end
desc "Run the integration spec"
- task :integration => :clean_env do
- sh "bacon spec/integration_spec.rb"
+ task :integration => :unpack_fixture_tarballs do
+ sh "bundle exec bacon spec/integration_spec.rb"
end
- task :all => :clean_env do
- sh "bacon #{specs('**')}"
+ task :all => :unpack_fixture_tarballs do
+ sh "bundle exec bacon #{specs('**')}"
end
desc "Run all specs and build all examples"
@@ -104,13 +143,6 @@ namespace :spec do
end
end
end
-
- desc "Removes the stored VCR fixture"
- task :clean_vcr do
- sh "rm -f spec/fixtures/vcr/tarballs.yml"
- end
-
- task :clean_env => [:clean_vcr, :unpack_fixture_tarballs, "ext:cleanbuild"]
end
namespace :examples do
View
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
if $0 == __FILE__
- $:.unshift File.expand_path('../../external/Xcodeproj/ext', __FILE__)
- $:.unshift File.expand_path('../../external/Xcodeproj/lib', __FILE__)
+ require "rubygems"
+ require "bundler/setup"
$:.unshift File.expand_path('../../lib', __FILE__)
end
Submodule Xcodeproj deleted from 338e4d
@@ -14,11 +14,20 @@ def report(error)
https://github.com/CocoaPods/CocoaPods/issues/search?q=%22#{CGI.escape(error.message)}%22
-If none exists, create a ticket with the following information to:
+If none exists, create a ticket, with the information in the below (markdown formatted) template, on:
https://github.com/CocoaPods/CocoaPods/issues/new
-Don't forget to anonymize any private data!
+**Don't forget to anonymize any private data!**
+
+
+### Report
+
+* What did you do?
+
+* What did you expect to happen?
+
+* What happened instead?
### Stack
@@ -13,10 +13,8 @@ def initialize(podfile, project, target_definition)
def xcconfig
@xcconfig ||= Xcodeproj::Config.new({
# In a workspace this is where the static library headers should be found.
- 'PODS_ROOT' => '$(SRCROOT)/Pods',
+ 'PODS_ROOT' => '$(SRCROOT)/Pods',
'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
- # This makes categories from static libraries work, which many libraries
- # require, so we add these by default.
'OTHER_LDFLAGS' => default_ld_flags,
})
end
@@ -118,7 +116,7 @@ def quoted(strings)
def default_ld_flags
flags = %w{-ObjC -all_load}
- flags << '-fobjc-arc' if self.requires_arc
+ flags << '-fobjc-arc' if @podfile.set_arc_compatibility_flag? && self.requires_arc
flags.join(" ")
end
end
View
@@ -215,6 +215,19 @@ def post_install(&block)
@post_install_callback = block
end
+ # Specifies that the -fobjc-arc flag should be added to the OTHER_LD_FLAGS.
+ #
+ # This is used as a workaround for a compiler bug with non-ARC projects.
+ # (see https://github.com/CocoaPods/CocoaPods/issues/142)
+ #
+ # This was originally done automatically but libtool as of Xcode 4.3.2 no
+ # longer seems to support the -fobjc-arc flag. Therefore it now has to be
+ # enabled explicitly using this method.
+ #
+ # This may be removed in a future release.
+ def set_arc_compatibility_flag!
+ @set_arc_compatibility_flag = true
+ end
# Not attributes
@@ -236,6 +249,10 @@ def dependency_by_top_level_spec_name(name)
def generate_bridge_support?
@generate_bridge_support
end
+
+ def set_arc_compatibility_flag?
+ @set_arc_compatibility_flag
+ end
def post_install!(installer)
@post_install_callback.call(installer) if @post_install_callback
View
@@ -1,4 +1,5 @@
require 'rubygems'
+require 'bundler/setup'
require 'bacon'
require 'mocha-on-bacon'
@@ -7,8 +8,6 @@
require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
-$:.unshift File.expand_path('../../external/Xcodeproj/ext', __FILE__)
-$:.unshift File.expand_path('../../external/Xcodeproj/lib', __FILE__)
$:.unshift((ROOT + 'lib').to_s)
require 'cocoapods'
@@ -56,7 +55,9 @@ def copy_fixture_to_pod(name, pod)
require 'webmock'
VCR.configure do |c|
- c.cassette_library_dir = (ROOT + 'spec/fixtures/vcr').to_s
+ # Namespace the fixture by the Ruby version, because different Ruby versions
+ # can lead to different ways the data is interpreted.
+ c.cassette_library_dir = (ROOT + "spec/fixtures/vcr/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}").to_s
c.hook_into :webmock # or :fakeweb
c.allow_http_connections_when_no_cassette = true
end
@@ -48,6 +48,10 @@
Pod::Podfile.new {}.should.not.generate_bridge_support
Pod::Podfile.new { generate_bridge_support! }.should.generate_bridge_support
end
+
+ it 'specifies that ARC compatibility flag should be generated' do
+ Pod::Podfile.new { set_arc_compatibility_flag! }.should.set_arc_compatibility_flag
+ end
it "stores a block that will be called with the Installer instance once installation is finished (but the project is not written to disk yet)" do
yielded = nil
Oops, something went wrong.

0 comments on commit 8390a90

Please sign in to comment.