Skip to content

Commit

Permalink
Switch Rake execution to using XCTasks v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Watters committed Mar 25, 2014
1 parent 67af1dc commit 7204924
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -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'
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -38,6 +38,7 @@ GEM
colored (~> 1.2)
rake
xcpretty (0.1.3)
xctasks (0.1.0)

PLATFORMS
ruby
Expand All @@ -46,3 +47,4 @@ DEPENDENCIES
cocoapods (~> 0.29.0)
rake (~> 10.1.0)
xcpretty (~> 0.1.3)
xctasks (~> 0.1.0)
33 changes: 12 additions & 21 deletions 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

Expand Down

0 comments on commit 7204924

Please sign in to comment.