Commit f43e428e authored by Olivier Halligon's avatar Olivier Halligon

Fixing Rakefile's bootstrap

parent 54a496dc
task :build do
title "Building the gem"
end
require "bundler/gem_tasks"
# Bootstrap task
#-----------------------------------------------------------------------------#
......@@ -25,19 +19,33 @@ task :bootstrap, :use_bundle_dir? do |t, args|
ENV['ARCHFLAGS'] = '-Wno-error=unused-command-line-argument-hard-error-in-future'
end
if system('which bundle')
puts "Installing gems"
if args[:use_bundle_dir?]
execute_command "env XCODEPROJ_BUILD=1 bundle install --path ./travis_bundle_dir"
else
execute_command "env XCODEPROJ_BUILD=1 bundle install"
end
else
$stderr.puts red("[!] Please install the bundler gem manually:\n" \
' $ [sudo] gem install bundler')
exit 1
end
end
# Post release
#-----------------------------------------------------------------------------#
begin
task :build do
title "Building the gem"
end
require "bundler/gem_tasks"
desc "Updates the last know version of CocoaPods in the specs repo"
task :post_release do
# Post release
#-----------------------------------------------------------------------------#
desc "Updates the last know version of CocoaPods in the specs repo"
task :post_release do
title "Updating last known version in Specs repo"
specs_branch = 'master'
Dir.chdir('../Specs') do
......@@ -47,7 +55,7 @@ task :post_release do
yaml_file = 'CocoaPods-version.yml'
unless File.exist?(yaml_file)
$stderr.puts "[!] Unable to find #{yaml_file}!"
$stderr.puts red("[!] Unable to find #{yaml_file}!")
exit 1
end
require 'yaml'
......@@ -60,12 +68,12 @@ task :post_release do
sh "git commit #{yaml_file} -m 'CocoaPods release #{gem_version}'"
sh "git push"
end
end
end
# Spec
#-----------------------------------------------------------------------------#
# Spec
#-----------------------------------------------------------------------------#
namespace :spec do
namespace :spec do
def specs(dir)
FileList["spec/#{dir}_spec.rb"].shuffle.join(' ')
......@@ -105,7 +113,7 @@ namespace :spec do
desc "Run the integration spec"
task :integration do
unless File.exists?('spec/cocoapods-integration-specs')
$stderr.puts "Integration files not checked out. Run `rake bootstrap`"
$stderr.puts red("Integration files not checked out. Run `rake bootstrap`")
exit 1
end
......@@ -186,13 +194,13 @@ namespace :spec do
end
task :clean_env => [:clean_vcr, :unpack_fixture_tarballs, "ext:cleanbuild"]
end
end
# Examples
#-----------------------------------------------------------------------------#
# Examples
#-----------------------------------------------------------------------------#
task :examples => "examples:build"
namespace :examples do
task :examples => "examples:build"
namespace :examples do
desc "Open all example workspaces in Xcode, which recreates the schemes."
task :recreate_workspace_schemes do
......@@ -232,14 +240,19 @@ namespace :examples do
end
end
end
end
end
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
desc "Run all specs"
task :spec => 'spec:all'
desc "Run all specs"
task :spec => 'spec:all'
task :default => :spec
task :default => :spec
rescue LoadError
$stderr.puts red('[!] Some Rake tasks haven been disabled because the ' \
'environment couldn’t be loaded. Be sure to run `rake bootstrap` first.')
end
# Helpers
#-----------------------------------------------------------------------------#
......@@ -267,3 +280,6 @@ def title(title)
puts
end
def red(string)
"\033[0;31m#{string}\e[0m"
end
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