-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
92 lines (70 loc) · 1.79 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
TEST_PROJ_PATH="MaVec/MaVec.xcodeproj"
TEST_WORKSPACE_PATH="MaVec.xcworkspace"
TEST_SCHEME="MaVec"
#
# Install
#
namespace :install do
task :tools do
# don't care if this fails on travis
sh("brew update") rescue nil
sh("brew upgrade xctool") rescue nil
# sh("gem install cocoapods --no-rdoc --no-ri --no-document --quiet") rescue nil
end
# task :pods do
# sh("cd Tests && pod install")
# end
end
task :install do
Rake::Task['install:tools'].invoke
# Rake::Task['install:pods'].invoke
end
#
# Test
#
task :test do
sh("xctool -workspace '#{TEST_WORKSPACE_PATH}' -scheme '#{TEST_SCHEME}' -sdk iphonesimulator build test") rescue nil
exit $?.exitstatus
end
#
# Analyze
#
task :analyze do
sh("xctool -workspace '#{TEST_WORKSPACE_PATH}' -scheme '#{TEST_SCHEME}' -sdk iphonesimulator analyze -failOnWarnings") rescue nil
exit $?.exitstatus
end
#
# Clean
#
namespace :clean do
# task :pods do
# sh("rm -f Podfile.lock")
# sh "rm -rf Pods"
# sh("rm -rf *.xcworkspace")
# end
task :tests do
sh("xctool -project '#{TEST_PROJ_PATH}' -scheme '#{TEST_SCHEME}' -sdk iphonesimulator clean") rescue nil
end
end
task :clean do
# Rake::Task['clean:pods'].invoke
Rake::Task['clean:tests'].invoke
end
#
# Utils
#
task :usage do
puts "Usage:"
puts " rake install -- install all dependencies (xctool, cocoapods)"
puts " rake install:pods -- install cocoapods for tests"
puts " rake install:tools -- install build tool dependencies"
puts " rake test -- run unit tests"
puts " rake clean -- clean everything"
puts " rake clean:tests -- clean the test project build artifacts"
puts " rake clean:pods -- clean up cocoapods artifacts"
puts " rake usage -- print this message"
end
#
# Default
#
task :default => 'usage'