diff --git a/scripts/docs/generate_docc.sh b/scripts/docs/generate_docc.sh index cad892e25..d956bcb42 100755 --- a/scripts/docs/generate_docc.sh +++ b/scripts/docs/generate_docc.sh @@ -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); fi +export DOCC_HTML_DIR=${TOOLCHAIN}/usr/bin/docc -export DOCC_HTML_DIR=$docc_render_source_path/dist +$TOOLCHAIN/usr/bin/docc # Build documentation