-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
58 lines (45 loc) · 1.44 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
# encoding: UTF-8
class String
def self.colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def cyan
self.class.colorize(self, 36)
end
def green
self.class.colorize(self, 32)
end
end
desc 'Setup the project'
task :setup do
puts "Installing bundle...".cyan
sh "bundle install --jobs=4 --retry=2 --path=vendor/bundle"
puts "Installing pods...".cyan
sh "bundle exec pod install --project-directory=Tests"
end
desc 'Build and run tests'
task :test do
cmd = "set -o pipefail && xcodebuild "+
"-scheme SPLCoreTests "+
"-workspace Tests/SPLCoreTests.xcworkspace "+
"-sdk iphonesimulator "+
"-destination 'platform=iOS Simulator,name=iPhone 6' "+
"clean test "+
"ONLY_ACTIVE_ARCHS=NO "+
"GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES "+
"RUN_CLANG_STATIC_ANALYZER=NO | bundle exec xcpretty -c"
if ENV["CIRCLECI"] == "true"
cmd += " --report junit --output ${CIRCLE_TEST_REPORTS}/junit.xml"
end
sh "#{cmd}"
end
desc 'Lints SPLCore with various static analyzers'
task :lint do
puts "\nChecking for CocoaPods updates...".cyan
sh 'bundle exec pod outdated --project-directory=Tests'
puts "\nLinting file header styles...".cyan
sh 'bundle exec obcd --path SPLCore/Additions find HeaderStyle'
sh 'bundle exec obcd --path SPLCore/Models find HeaderStyle'
sh 'bundle exec obcd --path SPLCore find HeaderStyle'
end
task :default => :build