-
Notifications
You must be signed in to change notification settings - Fork 12
/
Rakefile
55 lines (41 loc) · 1.43 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def run(command)
p command
system(command) or raise "RAKE TASK FAILED: #{command}"
end
def currentDestination
if ENV['DESTINATION']
destination = ENV['DESTINATION']
else
destination = 'platform=iOS Simulator, name=iPhone 6s'
end
end
$PROJECT = "Shari"
$WORKSPACE = "#{$PROJECT}.xcworkspace"
namespace :clean do
task :app do
run "xcodebuild -workspace #{$WORKSPACE} -scheme #{$PROJECT}-Demo clean"
end
task :framework do
run "xcodebuild -workspace #{$WORKSPACE} -scheme #{$PROJECT} clean"
end
end
namespace :build do
desc "Build for all iOS targets"
task :app do |task, args|
destination = currentDestination
run "xcodebuild -workspace #{$WORKSPACE} -scheme #{$PROJECT} -destination '#{destination}' -configuration Debug clean build TEST_AFTER_BUILD=YES | xcpretty"
end
end
namespace :test do
desc "Test for "
task :app do |task, args|
destination = currentDestination
run "xcodebuild -workspace #{$WORKSPACE} -scheme #{$PROJECT}-Demo -destination '#{destination}' -destination-timeout 1 -sdk iphonesimulator -configuration Debug clean test | xcpretty"
end
desc "Test for Framework"
task :framework do |task, args|
destination = currentDestination
run "xcodebuild -workspace #{$WORKSPACE} -scheme #{$PROJECT} -destination '#{destination}' -destination-timeout 1 -sdk iphonesimulator -configuration Debug clean test | xcpretty"
end
end
task default: ["build:ios"]