From bf8a22f7d664902f9b260479c032b9a6d07e25f9 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Fri, 17 Dec 2021 09:50:41 +0000 Subject: [PATCH] Update doc generation script Motivation: The docs haven't been generated for a while. See also: /~https://github.com/apple/swift-nio/pull/2013 Modifications: - Pass `--spm` flag to sourcekitten - Update source location of sourcekitten - Fix link to NIO docs Result: Docs build. --- scripts/generate_docs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh index 055e932d..b94a4b34 100755 --- a/scripts/generate_docs.sh +++ b/scripts/generate_docs.sh @@ -26,20 +26,20 @@ if [[ "$(uname -s)" == "Linux" ]]; then swift build fi # setup source-kitten if required - source_kitten_source_path="$root_path/.SourceKitten" + mkdir -p "$root_path/.build/sourcekitten" + source_kitten_source_path="$root_path/.build/sourcekitten/source" if [[ ! -d "$source_kitten_source_path" ]]; then git clone /~https://github.com/jpsim/SourceKitten.git "$source_kitten_source_path" fi - source_kitten_path="$source_kitten_source_path/.build/x86_64-unknown-linux/debug" + source_kitten_path="$source_kitten_source_path/.build/debug" if [[ ! -d "$source_kitten_path" ]]; then rm -rf "$source_kitten_source_path/.swift-version" cd "$source_kitten_source_path" && swift build && cd "$root_path" fi # generate - mkdir -p "$root_path/.build/sourcekitten" for module in "${modules[@]}"; do if [[ ! -f "$root_path/.build/sourcekitten/$module.json" ]]; then - "$source_kitten_path/sourcekitten" doc --module-name $module > "$root_path/.build/sourcekitten/$module.json" + "$source_kitten_path/sourcekitten" doc --spm --module-name $module > "$root_path/.build/sourcekitten/$module.json" fi done fi @@ -81,7 +81,7 @@ cat >> "$module_switcher" <<"EOF" For the API documentation of the other repositories in the SwiftNIO family check: -- [`swift-nio` API docs](https://apple.github.io/swift-nio/docs/current/NIO/index.html) +- [`swift-nio` API docs](https://apple.github.io/swift-nio/docs/current/NIOCore/index.html) - [`swift-nio-ssl` API docs](https://apple.github.io/swift-nio-ssl/docs/current/NIOSSL/index.html) - [`swift-nio-http2` API docs](https://apple.github.io/swift-nio-http2/docs/current/NIOHTTP2/index.html) - [`swift-nio-extras` API docs](https://apple.github.io/swift-nio-extras/docs/current/NIOExtras/index.html)