forked from Przemyslaw-Wosko/Mocky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
40 lines (32 loc) · 1.14 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
## [ Mocks Generation ] ########################################################
task :mock do
print_info "Generating mocks"
sh "Pods/Sourcery/bin/sourcery --config mocky.yml"
end
task :debug do
print_info "Generating mocks - debug"
sh "Pods/Sourcery/bin/sourcery --config mocky.yml --disableCache --verbose"
end
## [ CocoaPods ] ###############################################################
desc "Install project dependencies"
desc "In case of need, pod repo update will be invoked"
task :pod_install do
begin
sh "pod install"
rescue
print_info "Install failed - trying repo update"
sh "pod repo update"
sh "pod install"
end
end
## [ Docs ] ####################################################################
desc "Update docs"
task :docs do
print_info "Updating docs"
sh "sourcekitten doc -- -workspace Mocky.xcworkspace -scheme SwiftyMocky > docs.json && jazzy --clean --skip-undocumented && rm docs.json"
end
## [ Helpers ] #################################################################
def print_info(str)
(red,clr) = (`tput colors`.chomp.to_i >= 8) ? %W(\e[33m \e[m) : ["", ""]
puts red, "== #{str.chomp} ==", clr
end