From 246da059866aab00928590896359dc6d4f73da61 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 22 Sep 2021 11:15:48 +0100 Subject: [PATCH] Fix doc generation and jazzy version (#15) Motivation: The combination of Ruby and Jazzy are throwing up issues in CI on older Ubuntu versions. Modifications: - Only install Jazzy on focal - Fix doc generation script to use more recent source-kitten syntax Results: - CI doesn't complain - Docs get built --- docker/Dockerfile | 8 +++----- scripts/generate_docs.sh | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d3c50df..6f6d76e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,12 +16,10 @@ ENV LANGUAGE en_US.UTF-8 RUN apt-get update && apt-get install -y wget RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools curl jq # used by integration tests -# ruby and jazzy for docs generation +# ruby and jazzy for docs generation, only on focal RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev build-essential -# switch off gem docs building -RUN echo "gem: --no-document" > ~/.gemrc -# jazzy no longer works on xenial as ruby is too old. -RUN if [ "${ubuntu_version}" != "xenial" ] ; then gem install jazzy; fi +RUN if [ "${ubuntu_version}" = "focal" ] ; then echo "gem: --no-document" > ~/.gemrc; fi +RUN if [ "${ubuntu_version}" == "focal" ] ; then gem install jazzy; fi # tools RUN mkdir -p $HOME/.tools diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh index 2b9e089..e7f9a0a 100755 --- a/scripts/generate_docs.sh +++ b/scripts/generate_docs.sh @@ -39,7 +39,7 @@ if [[ "$(uname -s)" == "Linux" ]]; then # generate for module in "${modules[@]}"; do if [[ ! -f "$root_path/.build/sourcekitten/$module.json" ]]; then - "$source_kitten_path/sourcekitten" doc --spm-module $module > "$root_path/.build/sourcekitten/$module.json" + "$source_kitten_path/sourcekitten" doc --module-name $module > "$root_path/.build/sourcekitten/$module.json" fi done fi