-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_docs.sh
executable file
·39 lines (26 loc) · 1.05 KB
/
build_docs.sh
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
#!/bin/bash
# Parse swift docs.
sourcekitten doc -- -project ./Decomposed.xcodeproj -scheme Decomposed -sdk iphonesimulator > swiftDocs.json
# Fix directory structure for sourcekitten.
# Find files to copy (all headers are currently public).
headers_to_copy=()
OLD_IFS=$IFS
IFS=$(echo -en "\n\b")
for tmp_copied_file in $(find Sources/Decomposed -name "*.h")
do
destination_url="Sources/Decomposed/$(basename $tmp_copied_file)"
headers_to_copy+=( $destination_url )
cp "$tmp_copied_file" "$destination_url"
done
sourcekitten doc --objc Sources/Decomposed.h -- -x objective-c -isysroot $(xcrun --show-sdk-path) -I $(pwd)/Sources > objcDocs.json
# Cleanup directory structure after sourcekitten.
for tmp_copied_file in $headers_to_copy
do
rm "$destination_url"
done
IFS=$OLD_IFS
# Merge swift and objc docs with jazzy.
jazzy --sourcekitten-sourcefile swiftDocs.json,objcDocs.json --author "Adam Bell" --author_url "https://twitter.com/b3ll" --undocumented-text "No overview available." --theme apple --clean
# Cleanup
rm swiftDocs.json
rm objcDocs.json