Skip to content

Commit 5475a18

Browse files
committed
Exit with the xcodebuild status code
1 parent adca08b commit 5475a18

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ before_install:
1414
install:
1515
- make install
1616
script:
17-
- xcodebuild -project ICInputAccessory.xcodeproj -scheme ICInputAccessory-iOS -sdk iphonesimulator -destination "name=iPhone 6,OS=$VERSION" clean build | xcpretty -c
18-
- xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6,OS=$VERSION" clean test | xcpretty -c
17+
- bundle exec rake ci:test[$VERSION]
1918
notifications:
2019
email: false
2120
slack:

Rakefile

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
task default: :build
1+
task default: "ci:test"
22

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
810
end
911

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
1335
end

0 commit comments

Comments
 (0)