Skip to content

Commit

Permalink
Fix Travis breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewatters committed Jun 4, 2013
1 parent b6d72df commit da8584b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ DerivedData
.idea/

Pods
TransitionKit.xcodeproj/xcshareddata/xcschemes
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ language: objective-c
before_install:
- brew update
- brew install xctool --HEAD
- mkdir -p TransitionKit.xcodeproj/xcshareddata/xcschemes && cp Specs/Schemes/*.xcscheme TransitionKit.xcodeproj/xcshareddata/xcschemes/
script: rake spec
23 changes: 18 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
def build_and_run_tests(command, sdk_name)
%w{build-tests test}.each do |action|
sdk = (action == 'test') ? "-test-sdk #{sdk_name}" : "-sdk #{sdk_name}"
cmd = command % { action: action, sdk: sdk }
puts "Executing `#{cmd}`..."
return unless system(cmd)
end
end

namespace :spec do
task :prepare do
system("mkdir -p TransitionKit.xcodeproj/xcshareddata/xcschemes && cp Specs/Schemes/*.xcscheme TransitionKit.xcodeproj/xcshareddata/xcschemes/")
end

desc "Run the TransitionKit Specs for iOS"
task :ios do
$ios_success = system("xctool -workspace TransitionKit.xcworkspace -scheme 'iOS Specs' test -test-sdk iphonesimulator")
task :ios => :prepare do
$ios_success = build_and_run_tests("xctool -workspace TransitionKit.xcworkspace -scheme 'iOS Specs' %{action} %{sdk} ONLY_ACTIVE_ARCH=NO", :iphonesimulator)
end

desc "Run the TransitionKit Specs for Mac OS X"
task :osx do
$osx_success = system("xctool -workspace TransitionKit.xcworkspace -scheme 'OS X Specs' test -test-sdk macosx -sdk macosx")
task :osx => :prepare do
$osx_success = build_and_run_tests("xctool -workspace TransitionKit.xcworkspace -scheme 'OS X Specs' %{action} %{sdk}", :macosx)
end
end

Expand All @@ -21,4 +34,4 @@ task :spec => ['spec:ios', 'spec:osx'] do
end
end

task :default => 'test'
task :default => 'spec'

0 comments on commit da8584b

Please sign in to comment.