Skip to content

Commit 6be8648

Browse files
authored
update doc generation script (#533)
- invoke source-kitten with the correct flags - make location of source-kitten source checkout more robust
1 parent d372bdc commit 6be8648

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docker/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools
1818

1919
# ruby and jazzy for docs generation
2020
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev build-essential
21-
# switch of gem docs building
22-
RUN if [ "${ubuntu_version}" = "focal" ] ; then echo "gem: --no-document" > ~/.gemrc ; fi
23-
RUN if [ "${ubuntu_version}" = "focal" ] ; then gem install jazzy ; fi
21+
# jazzy no longer works on xenial as ruby is too old.
22+
RUN if [ "${ubuntu_version}" = "focal" ] ; then echo "gem: --no-document" > ~/.gemrc; fi
23+
RUN if [ "${ubuntu_version}" = "focal" ] ; then gem install jazzy; fi
2424

2525
# tools
2626
RUN mkdir -p $HOME/.tools

scripts/generate_docs.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ if [[ "$(uname -s)" == "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)