Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions scripts/docs/generate_docc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,13 @@ declare -r build_path_linux="$build_path/"
declare -r docc_source_path="$root_path/.build/swift-docc"
declare -r docc_render_source_path="$root_path/.build/swift-docc-render"

# Prepare and build docc
if [[ ! -d "$docc_source_path" ]]; then
git clone https://github.com/apple/swift-docc.git "$docc_source_path"
cd $docc_source_path

if [[ ! -d "$docc_source_path/$build_path" ]]; then
swift build -c release
fi
else
echo "Assuming docc is built..."
fi


if [[ ! -d "$docc_render_source_path" ]]; then
git clone https://github.com/apple/swift-docc-render.git "$docc_render_source_path"
cd $docc_render_source_path

npm install
npm run build
else
echo "Assuming docc-render is built..."
# invoking docc from toolchain
if [-z ${TOOLCHAIN+x} ]; then
echo "TOOLCHAIN is unset"; exit(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives an error on my machine with zsh.

line 52: syntax error near unexpected token `1'

fi
export DOCC_HTML_DIR=${TOOLCHAIN}/usr/bin/docc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOCC_HTML_DIR should point to the docc-render dist dir or in the toolchain it is located at /usr/share/docc/render


export DOCC_HTML_DIR=$docc_render_source_path/dist
$TOOLCHAIN/usr/bin/docc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling docc seems useless here for me.

What we want is to export the env DOCC_HTML_DIR so that we can use it later when call docc in preview_docc.sh


# Build documentation

Expand Down