Skip to content

Commit c2e508a

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/generate_docs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ set -e
1818
my_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1919
root_path="$my_path/.."
2020
version=$(git describe --abbrev=0 --tags || echo "0.0.0")
21-
modules=(NIOExtras NIOHTTPCompression)
21+
modules=(NIOExtras NIOHTTPCompression NIOSOCKS)
2222

2323
if [[ "$(uname -s)" == "Linux" ]]; then
2424
# build code if required
2525
if [[ ! -d "$root_path/.build/x86_64-unknown-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
@@ -36,10 +37,9 @@ if [[ "$(uname -s)" == "Linux" ]]; then
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

0 commit comments

Comments
 (0)