diff --git a/Rakefile b/Rakefile index b4a13a26..991e2188 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,10 @@ require 'rake/testtask' Bundler::GemHelper.install_tasks -desc "Updates the json-schema common test suite to the latest version" -task :update_common_tests do +desc "Downloads the json-schema common test suite" +task :download_common_tests do + update_test_suite = !!ENV['UPDATE_TEST_SUITE'] + unless File.read(".git/config").include?('submodule "test/test-suite"') sh "git submodule init" end @@ -13,7 +15,7 @@ task :update_common_tests do puts "Updating json-schema common test suite..." begin - sh "git submodule update --remote --quiet" + sh "git submodule update --quiet" + (update_test_suite ? " --remote" : "") rescue StandardError STDERR.puts "Failed to update common test suite." end @@ -63,6 +65,4 @@ Rake::TestTask.new do |t| t.test_files = FileList.new('test/*_test.rb') end -task update: [:update_common_tests, :update_meta_schemas] - -task :default => :test +task :default => [:download_common_tests, :test]