From 628855e615b836f1674ef72bdfd42650f748132b Mon Sep 17 00:00:00 2001 From: George Barnett Date: Fri, 17 Dec 2021 10:11:02 +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: - Add NIOSOCKS module - Pass `--spm` flag to sourcekitten - Update source location of sourcekitten - Fix link to NIO docs Result: Docs build. --- scripts/generate_docs.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh index 827a6bba..adff6ab0 100755 --- a/scripts/generate_docs.sh +++ b/scripts/generate_docs.sh @@ -18,7 +18,7 @@ set -e my_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" root_path="$my_path/.." version=$(git describe --abbrev=0 --tags || echo "0.0.0") -modules=(NIOExtras NIOHTTPCompression) +modules=(NIOExtras NIOHTTPCompression NIOSOCKS) if [[ "$(uname -s)" == "Linux" ]]; then # build code if required @@ -26,7 +26,8 @@ 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 @@ -36,10 +37,9 @@ if [[ "$(uname -s)" == "Linux" ]]; then 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