Skip to content

Commit da0cb15

Browse files
authored
update doc generation script (#117)
motivation: source-kitten has changed how its invoked changes: * invoke source-kitten with the correct flags * make location of source-kitten source checkout more robust * udpate module list
1 parent 531c6f8 commit da0cb15

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/generate_docs.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ 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=(Lifecycle)
21+
modules=(Lifecycle LifecycleNIOCompat)
2222

2323
if [[ "$(uname -s)" == "Linux" ]]; then
2424
# build code if required
@@ -31,15 +31,15 @@ if [[ "$(uname -s)" == "Linux" ]]; then
3131
if [[ ! -d "$source_kitten_source_path" ]]; then
3232
git clone https://github.com/jpsim/SourceKitten.git "$source_kitten_source_path"
3333
fi
34-
source_kitten_path="$source_kitten_source_path/.build/x86_64-unknown-linux/debug"
34+
source_kitten_path="$source_kitten_source_path/.build/debug"
3535
if [[ ! -d "$source_kitten_path" ]]; then
3636
rm -rf "$source_kitten_source_path/.swift-version"
3737
cd "$source_kitten_source_path" && swift build && cd "$root_path"
3838
fi
3939
# generate
4040
for module in "${modules[@]}"; do
4141
if [[ ! -f "$root_path/.build/sourcekitten/$module.json" ]]; then
42-
"$source_kitten_path/sourcekitten" doc --spm-module $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
@@ -59,8 +59,14 @@ It also provides a Signal based shutdown hook, to shutdown on signals like TERM
5959
SwiftServiceLifecycle is non-framework specific, designed to be integrated with any server framework or directly in an application.
6060
6161
To get started with SwiftServiceLifecycle, [`import Lifecycle`](../Lifecycle/index.html).
62+
63+
SwiftServiceLifecycle contains multiple modules:
6264
EOF
6365

66+
for module in "${modules[@]}"; do
67+
echo " - [$module](../$module/index.html)" >> "$module_switcher"
68+
done
69+
6470
# run jazzy
6571
if ! command -v jazzy > /dev/null; then
6672
gem install jazzy --no-ri --no-rdoc

0 commit comments

Comments
 (0)