|
1 | | -task default: :build |
| 1 | +task default: "ci:test" |
2 | 2 |
|
3 | | -desc "Build the framework target and the example project" |
4 | | -task :build, [:os] do |t, args| |
5 | | - version = args[:os] || "latest" |
6 | | - sh %(xcodebuild -project ICInputAccessory.xcodeproj -scheme ICInputAccessory-iOS -sdk iphonesimulator -destination "name=iPhone 5,OS=#{version}" clean build | xcpretty -c) |
7 | | - sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 5,OS=#{version}" clean build | xcpretty -c) |
| 3 | +namespace :ci do |
| 4 | + desc "Run tests on Travis CI with a specified OS version, default OS=latest" |
| 5 | + task :test, [:os] do |t, args| |
| 6 | + version = args[:os] || "latest" |
| 7 | + Rake::Task["framework:build"].invoke version |
| 8 | + Rake::Task["example:test"].invoke version |
| 9 | + end |
8 | 10 | end |
9 | 11 |
|
10 | | -desc "Run the UI tests in the example project" |
11 | | -task :test do |t, args| |
12 | | - sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6,OS=latest" clean test | xcpretty -c) |
| 12 | +namespace :example do |
| 13 | + desc "Build the example project" |
| 14 | + task :build, [:os] do |t, args| |
| 15 | + version = args[:os] || "latest" |
| 16 | + sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 5,OS=#{version}" clean build | xcpretty -c && exit ${PIPESTATUS[0]}) |
| 17 | + exit $?.exitstatus if not $?.success? |
| 18 | + end |
| 19 | + |
| 20 | + desc "Run the UI tests in the example project" |
| 21 | + task :test, [:os] do |t, args| |
| 22 | + version = args[:os] || "latest" |
| 23 | + sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6,OS=#{version}" clean test | xcpretty -c && exit ${PIPESTATUS[0]}) |
| 24 | + exit $?.exitstatus if not $?.success? |
| 25 | + end |
| 26 | +end |
| 27 | + |
| 28 | +namespace :framework do |
| 29 | + desc "Build the framework project" |
| 30 | + task :build, [:os] do |t, args| |
| 31 | + version = args[:os] || "latest" |
| 32 | + sh %(xcodebuild -project ICInputAccessory.xcodeproj -scheme ICInputAccessory-iOS -sdk iphonesimulator -destination "name=iPhone 5,OS=#{version}" clean build | xcpretty -c && exit ${PIPESTATUS[0]}) |
| 33 | + exit $?.exitstatus if not $?.success? |
| 34 | + end |
13 | 35 | end |
0 commit comments