Commit 5a69f7ce authored by Marius Rackwitz's avatar Marius Rackwitz Committed by Samuel E. Giddins

[Rakefile] Move tasks for fixture tarballs into separate namespace

parent efd19fd6
...@@ -91,19 +91,19 @@ begin ...@@ -91,19 +91,19 @@ begin
unit_specs_command = "bundle exec bacon #{specs('unit/**/*')}" unit_specs_command = "bundle exec bacon #{specs('unit/**/*')}"
desc 'Run the unit specs' desc 'Run the unit specs'
task :unit => :unpack_fixture_tarballs do task :unit => 'fixture_tarballs:unpack' do
sh unit_specs_command sh unit_specs_command
end end
desc 'Run the unit specs quietly (fail fast, display only one failure)' desc 'Run the unit specs quietly (fail fast, display only one failure)'
task :unit_quiet => :unpack_fixture_tarballs do task :unit_quiet => 'fixture_tarballs:unpack' do
sh "#{unit_specs_command} -q" sh "#{unit_specs_command} -q"
end end
#--------------------------------------# #--------------------------------------#
desc 'Run the functional specs' desc 'Run the functional specs'
task :functional, [:spec] => :unpack_fixture_tarballs do |_t, args| task :functional, [:spec] => 'fixture_tarballs:unpack' do |_t, args|
args.with_defaults(:spec => '**/*') args.with_defaults(:spec => '**/*')
sh "bundle exec bacon #{specs("functional/#{args[:spec]}")}" sh "bundle exec bacon #{specs("functional/#{args[:spec]}")}"
end end
...@@ -126,7 +126,7 @@ begin ...@@ -126,7 +126,7 @@ begin
# The specs helper interfere with the integration 2 specs and thus they need # The specs helper interfere with the integration 2 specs and thus they need
# to be run separately. # to be run separately.
# #
task :all => :unpack_fixture_tarballs do task :all => 'fixture_tarballs:unpack' do
ENV['GENERATE_COVERAGE'] = 'true' ENV['GENERATE_COVERAGE'] = 'true'
puts "\033[0;32mUsing #{`ruby --version`}\033[0m" puts "\033[0;32mUsing #{`ruby --version`}\033[0m"
...@@ -143,22 +143,26 @@ begin ...@@ -143,22 +143,26 @@ begin
Rake::Task['rubocop'].invoke Rake::Task['rubocop'].invoke
end end
desc 'Rebuild all the fixture tarballs' namespace :fixture_tarballs do
task :rebuild_fixture_tarballs do task :default => :unpack
tarballs = FileList['spec/fixtures/**/*.tar.gz']
tarballs.each do |tarball| desc 'Rebuild all the fixture tarballs'
basename = File.basename(tarball) task :rebuild do
sh "cd #{File.dirname(tarball)} && rm #{basename} && env COPYFILE_DISABLE=1 tar -zcf #{basename} #{basename[0..-8]}" tarballs = FileList['spec/fixtures/**/*.tar.gz']
tarballs.each do |tarball|
basename = File.basename(tarball)
sh "cd #{File.dirname(tarball)} && rm #{basename} && env COPYFILE_DISABLE=1 tar -zcf #{basename} #{basename[0..-8]}"
end
end end
end
desc 'Unpacks all the fixture tarballs' desc 'Unpacks all the fixture tarballs'
task :unpack_fixture_tarballs do task :unpack do
tarballs = FileList['spec/fixtures/**/*.tar.gz'] tarballs = FileList['spec/fixtures/**/*.tar.gz']
tarballs.each do |tarball| tarballs.each do |tarball|
basename = File.basename(tarball) basename = File.basename(tarball)
Dir.chdir(File.dirname(tarball)) do Dir.chdir(File.dirname(tarball)) do
sh "rm -rf #{basename[0..-8]} && tar zxf #{basename}" sh "rm -rf #{basename[0..-8]} && tar zxf #{basename}"
end
end end
end end
end end
...@@ -201,7 +205,7 @@ begin ...@@ -201,7 +205,7 @@ begin
puts 'Integration fixtures updated, commit and push in the `spec/cocoapods-integration-specs` submodule' puts 'Integration fixtures updated, commit and push in the `spec/cocoapods-integration-specs` submodule'
end end
task :clean_env => [:clean_vcr, :unpack_fixture_tarballs, 'ext:cleanbuild'] task :clean_env => [:clean_vcr, 'fixture_tarballs:unpack', 'ext:cleanbuild']
end end
# Examples # Examples
......
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