Rocket/scripts/mk-docs.sh

32 lines
746 B
Bash
Raw 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
function mk_doc() {
local dir=$1
pushd "${dir}" > /dev/null 2>&1
2016-10-03 00:29:59 +00:00
echo ":: Documenting '${dir}'..."
cargo doc --no-deps --all-features
2017-04-23 07:03:14 +00:00
popd > /dev/null 2>&1
2016-10-03 00:29:59 +00:00
}
# We need to clean-up beforehand so we don't get all of the dependencies.
echo ":::: Cleaning up before documenting..."
cargo clean
cargo update
# Generate the rustdocs for all of the crates.
for dir in "${ALL_PROJECT_DIRS[@]}"; do
mk_doc "${dir}"
done
# Blank index, for redirection.
touch "${DOC_DIR}/index.html"