Skip to content

Commit

Permalink
Update doc generation script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glbrntt committed Dec 17, 2021
1 parent 6f8038f commit 628855e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/generate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ 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
if [[ ! -d "$root_path/.build/x86_64-unknown-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
Expand All @@ -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
Expand Down

0 comments on commit 628855e

Please sign in to comment.