Skip to content

Commit

Permalink
Update doc generation script (#335)
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:

- 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 2b329e3 commit 76164f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/generate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,7 +81,7 @@ To secure a server connection, you will need a X.509 certificate chain in a file
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)
Expand Down

0 comments on commit 76164f0

Please sign in to comment.