-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (28 loc) · 910 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'rake'
WORKSPACE_NAME = 'ConfreaksMTV.xcworkspace'
SCHEME_NAME = "ConfreaksMTV"
IPAD_AIR2_OS_11 = 'platform=iOS Simulator,name=iPad 2,OS=11.2'
IPHONE_X_OS_11 = 'platform=iOS Simulator,name=iPhone X,OS=11.2'
def execute(command)
system(command) or raise "** BUILD FAILED **"
end
def build(scheme)
execute "xcodebuild -workspace #{WORKSPACE_NAME} -scheme #{scheme} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO"
end
def test(scheme, device)
execute "xcodebuild test -workspace #{WORKSPACE_NAME} -scheme #{scheme} -sdk iphonesimulator -destination '#{device}' | xcpretty -tc && exit ${PIPESTATUS[0]}"
end
namespace :test do
desc 'Run specs on iPad 2, iOS 11'
task :ipad do
test(SCHEME_NAME, IPAD_AIR2_OS_11)
end
desc 'Run specs on iPhone 6, iOS 11'
task :iphone do
test(SCHEME_NAME, IPHONE_X_OS_11)
end
end
task :build do
build(SCHEME_NAME)
end
task default: 'test:iphone'