forked from sharplet/EnumeratorKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
77 lines (63 loc) · 1.84 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
XCODEBUILD_OPTS = "-workspace EnumeratorKit.xcworkspace -derivedDataPath DerivedData"
IPHONE6 = "-scheme EnumeratorKit-iOS -destination 'platform=iOS Simulator,name=iPhone 6'"
IPHONE5 = "-scheme EnumeratorKit-iOS -destination 'platform=iOS Simulator,name=iPhone 5'"
MACOSX = "-scheme EnumeratorKit-OSX -destination 'generic/platform=OS X'"
def xcpretty(cmd)
sh "set -o pipefail; #{cmd} | xcpretty -c"
end
task default: %w[test]
task ci: %w[test podspec:lint]
desc "Run all tests"
task test: %w[test:iphone6 test:iphone5 test:macosx]
namespace :test do
desc "Test on iPhone 6"
task :iphone6 do
xcpretty "xcodebuild test #{XCODEBUILD_OPTS} #{IPHONE6}"
end
desc "Test on iPhone 5"
task :iphone5 do
xcpretty "xcodebuild test #{XCODEBUILD_OPTS} #{IPHONE5}"
end
desc "Test on Mac OS X"
task :macosx do
xcpretty "xcodebuild test #{XCODEBUILD_OPTS} #{MACOSX}"
end
end
namespace :podspec do
desc "Validate the podspec"
task :lint do
sh "pod lib lint"
end
end
desc "Clean the default scheme"
task :clean do
rm_rf "DerivedData"
end
desc "Synonym for docs:generate"
task :docs => :'docs:generate'
namespace :docs do
desc "Generate documentation"
task :generate do
options = [
'--project-name', 'EnumeratorKit',
'--project-company', 'EnumeratorKit',
'--company-id', 'com.sharplet.EnumeratorKit',
'--output', 'appledoc',
'--logformat', 'xcode',
'--print-information-block-titles',
'--use-code-order',
'--create-html',
'--warn-undocumented-member',
'--no-create-docset',
'--no-repeat-first-par',
'--no-warn-invalid-crossref',
'--warn-missing-arg'
]
options << '--' << Dir['**/*.h']
system 'appledoc', *options.flatten
end
desc "Open the documentation in a web browser"
task :open do
system 'open', 'appledoc/html/index.html'
end
end