Rocket/scripts/mk-docs.sh

35 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2016-10-03 00:29:59 +00:00
#!/bin/bash
set -e
#
# Builds the rustdocs for all of the libraries.
#
# Brings in: PROJECT_ROOT, EXAMPLES_DIR, LIB_DIR, CODEGEN_DIR, CONTRIB_DIR, DOC_DIR
2016-10-03 00:29:59 +00:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPT_DIR}/config.sh"
2016-10-03 00:29:59 +00:00
if [ "${1}" != "-d" ]; then
# We need to clean-up beforehand so we don't get all of the dependencies.
echo ":::: Cleaning up before documenting..."
cargo clean
cargo update
fi
# Generate the rustdocs for all of the crates.
echo ":::: Generating docs (${DOC_VERSION})..."
2018-10-07 04:16:02 +00:00
pushd "${PROJECT_ROOT}" > /dev/null 2>&1
# Set the crate version and fill in missing doc URLs with docs.rs links.
RUSTDOCFLAGS="-Z unstable-options \
2024-02-28 21:23:19 +00:00
--extern-html-root-url rocket=https://api.rocket.rs/${GIT_BRANCH}/rocket/ \
--crate-version ${DOC_VERSION} \
2024-02-28 21:23:19 +00:00
--enable-index-page \
--generate-link-to-definition" \
cargo doc -Zrustdoc-map --no-deps --all-features \
-p rocket \
-p rocket_db_pools \
-p rocket_sync_db_pools \
-p rocket_dyn_templates \
-p rocket_ws
2018-10-07 04:16:02 +00:00
popd > /dev/null 2>&1