@@ -4,14 +4,6 @@ default_platform :ios
4
4
5
5
platform :ios do
6
6
7
-
8
- # Documentation ==============
9
-
10
- desc "Build documentation"
11
- lane :documentation do |options |
12
- sh ( 'cd .. && fastlane/build-documentation.sh' )
13
- end
14
-
15
7
16
8
# Lint =======================
17
9
@@ -45,21 +37,92 @@ platform :ios do
45
37
desc "Create a new version"
46
38
lane :version do |options |
47
39
ensure_release_ready
48
-
49
40
documentation
50
41
51
42
bump_type = options [ :type ]
52
- if bump_type == nil or bump_type . empty?
53
- bump_type = "patch"
54
- end
55
-
56
- version = version_bump_podspec ( path : "KeyboardKit.podspec" , bump_type : bump_type )
43
+ version = version_bump_podspec (
44
+ path : "KeyboardKit.podspec" ,
45
+ bump_type : bump_type )
46
+
57
47
git_commit ( path : "*" , message : "Bump to #{ version } " )
58
-
59
48
add_git_tag ( tag : version )
60
49
push_git_tags ( )
61
50
push_to_git_remote ( )
62
51
pod_push ( )
63
52
end
64
-
53
+
54
+
55
+ # Docs =======================
56
+
57
+ desc "Build documentation for all platforms"
58
+ lane :docc do
59
+ sh ( 'cd .. && rm -rf Docs' )
60
+ docc_platform ( destination : 'iOS' , name : 'ios' )
61
+ docc_platform ( destination : 'OS X' , name : 'osx' )
62
+ docc_platform ( destination : 'tvOS' , name : 'tvos' )
63
+ docc_platform ( destination : 'watchOS' , name : 'watchos' )
64
+ end
65
+
66
+ desc "Build documentation for a single platform"
67
+ lane :docc_platform do |values |
68
+ sh ( 'cd .. && mkdir -p Docs' )
69
+ docc_delete_derived_data
70
+ sh ( 'cd .. && xcodebuild docbuild \
71
+ -scheme KeyboardKit \
72
+ -destination \'generic/platform=' + values [ :destination ] + '\'' )
73
+ sh ( 'cd .. && \
74
+ find ~/Library/Developer/Xcode/DerivedData \
75
+ -name "KeyboardKit.doccarchive" \
76
+ -exec cp -R {} Docs \;' )
77
+ sh ( 'cd .. && \
78
+ mv Docs/KeyboardKit.doccarchive Docs/KeyboardKit_' + values [ :name ] + '.doccarchive' )
79
+ end
80
+
81
+ desc "Delete documentation derived data (may be historic duplicates)"
82
+ lane :docc_delete_derived_data do
83
+ sh ( 'find ~/Library/Developer/Xcode/DerivedData \
84
+ -name "KeyboardKit.doccarchive" \
85
+ -exec rm -Rf {} \; || true' )
86
+ end
87
+
88
+ desc "Build static documentation websites for all platforms"
89
+ lane :docc_web do
90
+ docc
91
+ docc_web_platform ( name : 'ios' )
92
+ docc_web_platform ( name : 'osx' )
93
+ docc_web_platform ( name : 'tvos' )
94
+ docc_web_platform ( name : 'watchos' )
95
+ end
96
+
97
+ desc "Build static documentation website for a single platform"
98
+ lane :docc_web_platform do |values |
99
+ sh ( 'cd .. && $(xcrun --find docc) process-archive \
100
+ transform-for-static-hosting Docs/KeyboardKit_' + values [ :name ] + '.doccarchive \
101
+ --output-path Docs/web_' + values [ :name ] + ' \
102
+ --hosting-base-path KeyboardKit' )
103
+ end
104
+
105
+ desc "Build static web documentation (macOS only)"
106
+ lane :docc_web_plugin do
107
+ sh ( 'cd .. && mkdir -p Docs' )
108
+ sh ( 'cd .. && swift package \
109
+ --allow-writing-to-directory Docs \
110
+ generate-documentation \
111
+ --disable-indexing \
112
+ --transform-for-static-hosting \
113
+ --hosting-base-path KeyboardKit \
114
+ --output-path Docs/web' )
115
+ end
116
+
117
+ desc "Build and preview static documentation website (macOS only)"
118
+ lane :docc_webpreview_plugin do
119
+ sh ( 'cd .. && mkdir -p Docs' )
120
+ sh ( 'cd .. && swift package \
121
+ --disable-sandbox \
122
+ preview-documentation \
123
+ --transform-for-static-hosting \
124
+ --hosting-base-path KeyboardKit \
125
+ --output-path Docs/web' )
126
+ end
127
+
65
128
end
0 commit comments