-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRakefile
More file actions
60 lines (42 loc) · 1.3 KB
/
Rakefile
File metadata and controls
60 lines (42 loc) · 1.3 KB
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
# encoding: UTF-8
# Bequest
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 'Installs dependencies and pods'
task :setup do
puts "Installing bundle...".cyan
sh "bundle check --path=vendor/bundle || bundle install --jobs=4 --retry=2 --path=vendor/bundle"
puts "Installing Pods...".cyan
sh "bundle exec pod install --project-directory=src"
end
desc 'Runs all Bequest Tests'
task :test do
puts "Running Bequest Tests...".cyan
test_command = "set -o pipefail && xcodebuild "+
"-scheme 'Bequest Dev' "+
"-workspace 'src/Bequest.xcworkspace' "+
"-sdk iphonesimulator "+
"-destination \"platform=iOS Simulator,name=iPhone 6\" "+
"clean test | bundle exec xcpretty -c"
if ENV['CIRCLECI'] == 'true'
test_command += " --report junit --output ${CIRCLE_TEST_REPORTS}/junit.xml"
end
sh "#{test_command}"
end
desc 'Runs various static analyzers and linters'
task :lint do
sh "bundle exec pod outdated --project-directory=src"
puts `bundle exec obcd --path src/Bequest find HeaderStyle`
swiftlint = "/usr/local/bin/swiftlint lint --path "
puts `#{swiftlint} src/Bequest`
puts `#{swiftlint} src/BequestTests`
end