1
1
task default : "ci:test"
2
2
3
+ latest = "10.2"
4
+
3
5
namespace :ci do
4
- desc "Build targets on Travis CI with a specified OS version, default OS=latest"
6
+ desc "Build targets on Travis CI with a specified OS version, default OS=#{ latest } "
5
7
task :build , [ :os ] do |t , args |
6
- version = args [ :os ] || " latest"
8
+ version = args [ :os ] || latest
7
9
Rake ::Task [ "framework:build" ] . invoke version
8
10
Rake ::Task [ "example:build" ] . invoke version
9
11
end
10
12
11
- desc "Run tests on Travis CI with a specified OS version, default OS=latest"
13
+ desc "Run tests on Travis CI with a specified OS version, default OS=#{ latest } "
12
14
task :test , [ :os ] do |t , args |
13
- version = args [ :os ] || " latest"
15
+ version = args [ :os ] || latest
14
16
Rake ::Task [ "framework:build" ] . invoke version
15
17
# UI Testing requires iOS Simulator 9.0 or later.
16
- if version == "latest" || Gem ::Version . new ( "9.0" ) <= Gem ::Version . new ( version )
18
+ if Gem ::Version . new ( "9.0" ) <= Gem ::Version . new ( version )
17
19
Rake ::Task [ "example:test" ] . invoke version
18
20
else
19
21
Rake ::Task [ "example:build" ] . invoke version
24
26
namespace :example do
25
27
desc "Build the example project"
26
28
task :build , [ :os ] do |t , args |
27
- version = args [ :os ] || " latest"
28
- sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 5 ,OS=#{ version } " clean build | xcpretty -c && exit ${PIPESTATUS[0]})
29
+ version = args [ :os ] || latest
30
+ sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6s ,OS=#{ version } " clean build | xcpretty -c && exit ${PIPESTATUS[0]})
29
31
exit $?. exitstatus if not $?. success?
30
32
end
31
33
32
34
desc "Run the UI tests in the example project"
33
35
task :test , [ :os ] do |t , args |
34
- version = args [ :os ] || " latest"
35
- sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6 ,OS=#{ version } " clean test | xcpretty -c && exit ${PIPESTATUS[0]})
36
+ version = args [ :os ] || latest
37
+ sh %(xcodebuild -workspace ICInputAccessory.xcworkspace -scheme Example -sdk iphonesimulator -destination "name=iPhone 6s ,OS=#{ version } " clean test | xcpretty -c && exit ${PIPESTATUS[0]})
36
38
exit $?. exitstatus if not $?. success?
37
39
end
38
40
end
@@ -41,7 +43,7 @@ namespace :framework do
41
43
desc "Build the framework project"
42
44
task :build , [ :os ] do |t , args |
43
45
version = args [ :os ] || "latest"
44
- sh %(xcodebuild -project ICInputAccessory.xcodeproj -scheme ICInputAccessory-iOS -sdk iphonesimulator -destination "name=iPhone 5 ,OS=#{ version } " clean build | xcpretty -c && exit ${PIPESTATUS[0]})
46
+ sh %(xcodebuild -project ICInputAccessory.xcodeproj -scheme ICInputAccessory-iOS -sdk iphonesimulator -destination "name=iPhone 6s ,OS=#{ version } " clean build | xcpretty -c && exit ${PIPESTATUS[0]})
45
47
exit $?. exitstatus if not $?. success?
46
48
end
47
49
end
0 commit comments