Skip to content

Commit bec04ab

Browse files
authored
Update doc generation script (#322)
Motivation: The docs haven't been generated for a while. See also: apple/swift-nio#2013 Modifications: - Pass `--spm` flag to sourcekitten - Update source location of sourcekitten - Fix link to NIO docs Result: Docs build.
1 parent 6e94a7b commit bec04ab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/generate_docs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ if [[ "$(uname -s)" == "Linux" ]]; then
2626
swift build
2727
fi
2828
# setup source-kitten if required
29-
source_kitten_source_path="$root_path/.SourceKitten"
29+
mkdir -p "$root_path/.build/sourcekitten"
30+
source_kitten_source_path="$root_path/.build/sourcekitten/source"
3031
if [[ ! -d "$source_kitten_source_path" ]]; then
3132
git clone https://github.com/jpsim/SourceKitten.git "$source_kitten_source_path"
3233
fi
33-
source_kitten_path="$source_kitten_source_path/.build/x86_64-unknown-linux/debug"
34+
source_kitten_path="$source_kitten_source_path/.build/debug"
3435
if [[ ! -d "$source_kitten_path" ]]; then
3536
rm -rf "$source_kitten_source_path/.swift-version"
3637
cd "$source_kitten_source_path" && swift build && cd "$root_path"
3738
fi
3839
# generate
39-
mkdir -p "$root_path/.build/sourcekitten"
4040
for module in "${modules[@]}"; do
4141
if [[ ! -f "$root_path/.build/sourcekitten/$module.json" ]]; then
42-
"$source_kitten_path/sourcekitten" doc --module-name $module > "$root_path/.build/sourcekitten/$module.json"
42+
"$source_kitten_path/sourcekitten" doc --spm --module-name $module > "$root_path/.build/sourcekitten/$module.json"
4343
fi
4444
done
4545
fi
@@ -81,7 +81,7 @@ cat >> "$module_switcher" <<"EOF"
8181
8282
For the API documentation of the other repositories in the SwiftNIO family check:
8383
84-
- [`swift-nio` API docs](https://apple.github.io/swift-nio/docs/current/NIO/index.html)
84+
- [`swift-nio` API docs](https://apple.github.io/swift-nio/docs/current/NIOCore/index.html)
8585
- [`swift-nio-ssl` API docs](https://apple.github.io/swift-nio-ssl/docs/current/NIOSSL/index.html)
8686
- [`swift-nio-http2` API docs](https://apple.github.io/swift-nio-http2/docs/current/NIOHTTP2/index.html)
8787
- [`swift-nio-extras` API docs](https://apple.github.io/swift-nio-extras/docs/current/NIOExtras/index.html)

0 commit comments

Comments
 (0)