forked from rwf2/Rocket
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mk-docs.sh
executable file
·30 lines (25 loc) · 933 Bytes
/
mk-docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPT_DIR}/config.sh"
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 the docs..."
pushd "${PROJECT_ROOT}" > /dev/null 2>&1
# Set the crate version and fill in missing doc URLs with docs.rs links.
RUSTDOCFLAGS="-Zunstable-options --crate-version ${DOC_VERSION}" \
cargo doc -p rocket \
-p rocket_sync_db_pools -p rocket_dyn_templates -p rocket_db_pools \
-Zrustdoc-map --no-deps --all-features
popd > /dev/null 2>&1
# Blank index, for redirection.
touch "${DOC_DIR}/index.html"