From 7204924f2261e3201db1e3bd9df3e7e386349434 Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Tue, 25 Mar 2014 15:18:38 -0400 Subject: [PATCH] Switch Rake execution to using XCTasks v0.1.0 --- Gemfile | 1 + Gemfile.lock | 2 ++ Rakefile | 33 ++++++++++++--------------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index be0df72..233f301 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ source 'http://rubygems.org' gem 'rake', '~> 10.1.0' gem 'cocoapods', '~> 0.29.0' gem 'xcpretty', '~> 0.1.3' +gem 'xctasks', '~> 0.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index a43bae7..c0f32ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,7 @@ GEM colored (~> 1.2) rake xcpretty (0.1.3) + xctasks (0.1.0) PLATFORMS ruby @@ -46,3 +47,4 @@ DEPENDENCIES cocoapods (~> 0.29.0) rake (~> 10.1.0) xcpretty (~> 0.1.3) + xctasks (~> 0.1.0) diff --git a/Rakefile b/Rakefile index 586ca87..a615f3e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,29 +1,20 @@ require 'rubygems' +require 'bundler' +Bundler.setup +require 'xctasks/test_task' -namespace :spec do - task :prepare do - system("mkdir -p TransitionKit.xcodeproj/xcshareddata/xcschemes && cp Specs/Schemes/*.xcscheme TransitionKit.xcodeproj/xcshareddata/xcschemes/") - end +XCTasks::TestTask.new(:spec) do |t| + t.workspace = 'TransitionKit.xcworkspace' + t.schemes_dir = 'Specs/Schemes' + t.runner = :xcpretty + t.actions = %w{clean test} - desc "Run the TransitionKit Specs for iOS" - task :ios => :prepare do - $ios_success = system("xcodebuild -workspace TransitionKit.xcworkspace -scheme 'iOS Specs' -sdk iphonesimulator clean test | xcpretty -c ; exit ${PIPESTATUS[0]}") + t.subtask(ios: 'iOS Specs') do |s| + s.sdk = :iphonesimulator end - desc "Run the TransitionKit Specs for Mac OS X" - task :osx => :prepare do - $osx_success = system("xcodebuild -workspace TransitionKit.xcworkspace -scheme 'OS X Specs' -sdk macosx clean test | xcpretty -c ; exit ${PIPESTATUS[0]}") - end -end - -desc "Run the TransitionKit Specs for iOS & Mac OS X" -task :spec => ['spec:ios', 'spec:osx'] do - puts "\033[0;31m!! iOS specs failed" unless $ios_success - puts "\033[0;31m!! OS X specs failed" unless $osx_success - if $ios_success && $osx_success - puts "\033[0;32m** All tests executed successfully" - else - exit(-1) + t.subtask(osx: 'OS X Specs') do |s| + s.sdk = :macosx end end