2016-10-03 00:29:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
#
|
|
|
|
# Builds the rustdocs for all of the libraries.
|
|
|
|
#
|
|
|
|
|
2018-06-07 13:34:47 +00:00
|
|
|
# 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 )"
|
2017-07-29 04:34:59 +00:00
|
|
|
source "${SCRIPT_DIR}/config.sh"
|
2016-10-03 00:29:59 +00:00
|
|
|
|
2018-10-10 11:20:50 +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
|
2024-02-25 22:39:41 +00:00
|
|
|
# cargo update
|
2018-10-10 11:20:50 +00:00
|
|
|
fi
|
2016-10-03 00:51:35 +00:00
|
|
|
|
2018-06-07 13:34:47 +00:00
|
|
|
# Generate the rustdocs for all of the crates.
|
2018-10-07 04:16:02 +00:00
|
|
|
echo ":::: Generating the docs..."
|
|
|
|
pushd "${PROJECT_ROOT}" > /dev/null 2>&1
|
2020-11-10 07:08:51 +00:00
|
|
|
RUSTDOCFLAGS="-Z unstable-options --crate-version ${DOC_VERSION}" \
|
2024-02-25 22:39:41 +00:00
|
|
|
cargo doc -Zrustdoc-map -p rocket --no-deps
|
|
|
|
cargo doc -Zrustdoc-map -p rocket_contrib --no-deps --all-features
|
2018-10-07 04:16:02 +00:00
|
|
|
popd > /dev/null 2>&1
|
2016-12-22 06:56:58 +00:00
|
|
|
|
|
|
|
# Blank index, for redirection.
|
2017-07-29 04:34:59 +00:00
|
|
|
touch "${DOC_DIR}/index.html"
|