|
1 | | -WORKSPASE = "JavaScriptBridge.xcworkspace" |
2 | | -SCHEME = "Tests" |
3 | 1 | DESTINATIONS = ["name=iPhone Retina (3.5-inch),OS=7.0", |
4 | 2 | "name=iPhone Retina (4-inch),OS=7.0", |
5 | 3 | "name=iPhone Retina (4-inch 64-bit),OS=7.0"] |
6 | 4 |
|
7 | | -task :default => [:clean, :test] |
| 5 | +task :default => [:build, :clean, :test] |
| 6 | + |
| 7 | +desc "build" |
| 8 | +task :build, :workspace, :schemes do |t, args| |
| 9 | + schemes = args[:schemes].gsub(/'/, '').split(' ') |
| 10 | + schemes.each do |scheme| |
| 11 | + system("xcodebuild -workspace #{args[:workspace]} -scheme #{scheme} | xcpretty -c") |
| 12 | + end |
| 13 | +end |
8 | 14 |
|
9 | 15 | desc "clean" |
10 | | -task :clean do |
11 | | - system("xcodebuild clean -workspace #{WORKSPASE} -scheme #{SCHEME} | xcpretty -c") |
| 16 | +task :clean, :workspace, :schemes do |t, args| |
| 17 | + schemes = args[:schemes].gsub(/'/, '').split(' ') |
| 18 | + schemes.each do |scheme| |
| 19 | + system("xcodebuild clean -workspace #{args[:workspace]} -scheme #{scheme} | xcpretty -c") |
| 20 | + end |
12 | 21 | end |
13 | 22 |
|
14 | 23 | desc "run unit tests" |
15 | | -task :test do |
16 | | - DESTINATIONS.each do |destination| |
17 | | - system("xcodebuild test -workspace #{WORKSPASE} -scheme #{SCHEME} -configuration Debug -sdk iphonesimulator -destination \"#{destination}\" | xcpretty -c") |
| 24 | +task :test, :workspace, :schemes do |t, args| |
| 25 | + schemes = args[:schemes].gsub(/'/, '').split(' ') |
| 26 | + schemes.each do |scheme| |
| 27 | + DESTINATIONS.each do |destination| |
| 28 | + system("xcodebuild test -workspace #{args[:workspace]} -scheme #{scheme} -configuration Debug -sdk iphonesimulator -destination \"#{destination}\" | xcpretty -c") |
| 29 | + end |
18 | 30 | end |
19 | 31 | end |
0 commit comments