Commit 33c5269e authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'integration_take_2' into 0.17

* integration_take_2:
  [Integration] Isolate from spec helper and clean up Rakefile
  [Integration] Update install_subspecs
  [Examples] Updates lockfiles.

Conflicts:
	examples/AFNetworking Mac Example/Podfile.lock
	examples/AFNetworking iOS Example/Podfile.lock
	examples/TargetTest/Podfile.lock
	spec/integration/install_subspecs/after/Podfile.lock
parents 36006365 b40574f2
......@@ -7,7 +7,10 @@ def execute_command(command)
end
end
#-----------------------------------------------------------------------------#
namespace :gem do
def gem_version
require File.expand_path('../lib/cocoapods', __FILE__)
Pod::VERSION
......@@ -17,16 +20,22 @@ namespace :gem do
"cocoapods-#{gem_version}.gem"
end
#--------------------------------------#
desc "Build a gem for the current version"
task :build do
sh "gem build cocoapods.gemspec"
end
#--------------------------------------#
desc "Install a gem version of the current code"
task :install => :build do
sh "gem install #{gem_filename}"
end
#--------------------------------------#
def silent_sh(command)
output = `#{command} 2>&1`
unless $?.success?
......@@ -139,41 +148,91 @@ namespace :gem do
end
end
#-----------------------------------------------------------------------------#
namespace :spec do
def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end
def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts "-" * 80
puts "| #{cyan_title.ljust(87)} |"
puts "-" * 80
puts
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 "bundle exec bacon #{specs('unit/**')} -q"
end
#--------------------------------------#
desc "Run the functional specs"
task :functional => :unpack_fixture_tarballs do
sh "bundle exec bacon #{specs('functional/**')}"
end
#--------------------------------------#
desc "Run the integration spec"
task :integration => :unpack_fixture_tarballs do
sh "bundle exec bacon spec/integration_spec.rb"
sh "bundle exec bacon spec/integration_2.rb"
end
# Default task
#--------------------------------------#
#
# The specs helper interfere with the integration 2 specs and thus they need
# to be run separately.
#
task :all => :unpack_fixture_tarballs do
sh "bundle exec bacon #{specs('**')}"
title 'Running the specs'
sh "bundle exec bacon #{specs('**')}"
title 'Running Integration 2 tests'
sh "bundle exec bacon spec/integration_2.rb"
title 'Running examples'
Rake::Task['examples:build'].invoke
end
# Travis
#--------------------------------------#
#
# The integration 2 tests and the examples use the normal CocoaPods setup.
#
desc "Run all specs and build all examples"
task :ci => :all do
sh "./bin/pod setup" # ensure the spec repo is up-to-date
task :ci => :unpack_fixture_tarballs do
title 'Running the specs'
sh "bundle exec bacon #{specs('**')}"
title 'Ensuring specs repo is up to date'
sh "./bin/pod setup"
title 'Running Integration 2 tests'
sh "bundle exec bacon spec/integration_2.rb"
title 'Running examples'
Rake::Task['examples:build'].invoke
end
#--------------------------------------#
desc "Rebuild all the fixture tarballs"
task :rebuild_fixture_tarballs do
tarballs = FileList['spec/fixtures/**/*.tar.gz']
......@@ -183,6 +242,8 @@ namespace :spec do
end
end
#--------------------------------------#
desc "Unpacks all the fixture tarballs"
task :unpack_fixture_tarballs do
tarballs = FileList['spec/fixtures/**/*.tar.gz']
......@@ -194,11 +255,15 @@ namespace :spec do
end
end
#--------------------------------------#
desc "Removes the stored VCR fixture"
task :clean_vcr do
sh "rm -f spec/fixtures/vcr/tarballs.yml"
end
#--------------------------------------#
desc "Rebuild integration take 2 after folders"
task :rebuild_integration_after_folders do
# TODO Run the tests manually before calling this for now
......@@ -218,13 +283,17 @@ namespace :spec do
FileList['spec/integration/*/after/{Podfile,**/*.xcodeproj}'].each do |to_delete|
sh "rm -rf #{to_delete}"
end
end
#--------------------------------------#
task :clean_env => [:clean_vcr, :unpack_fixture_tarballs, "ext:cleanbuild"]
end
#-----------------------------------------------------------------------------#
namespace :examples do
def examples
require 'pathname'
result = []
......@@ -239,7 +308,9 @@ namespace :examples do
result
end
desc "Open all example workspaced in Xcode, which recreates the schemes."
#--------------------------------------#
desc "Open all example workspaces in Xcode, which recreates the schemes."
task :recreate_workspace_schemes do
examples.each do |example|
Dir.chdir(example.to_s) do
......@@ -251,6 +322,8 @@ namespace :examples do
end
end
#--------------------------------------#
desc "Build all examples"
task :build do
execute_command "rm -rf ~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.*"
......@@ -269,8 +342,13 @@ namespace :examples do
end
end
end
#--------------------------------------#
end
#-----------------------------------------------------------------------------#
desc "Initializes your working copy to run the specs"
task :bootstrap do
puts "Updating submodules"
......@@ -280,10 +358,12 @@ task :bootstrap do
execute_command "bundle install"
puts "Installing tools (Homebrew)"
execute_command "brew install appledoc" if `which appledoc`.strip.empty?
execute_command "brew install appledoc" if `which appledoc`.strip.empty?
execute_command "brew install mercurial" if `which hg`.strip.empty?
end
#-----------------------------------------------------------------------------#
desc "Run all specs"
task :spec => 'spec:all'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment