Inline macro docs into core crate.

This commit is contained in:
Sergio Benitez 2020-02-25 16:56:59 -08:00
parent 39b1f2f8d0
commit 32e86c3b69
4 changed files with 23 additions and 9 deletions

View File

@ -93,10 +93,7 @@
//! [testing chapter of the guide]: https://rocket.rs/v0.5/guide/testing/#testing //! [testing chapter of the guide]: https://rocket.rs/v0.5/guide/testing/#testing
#[allow(unused_imports)] #[macro_use] extern crate rocket_codegen; #[allow(unused_imports)] #[macro_use] extern crate rocket_codegen;
// FIXME(rustdoc): We should be able to doc(inline) and not doc the pub use rocket_codegen::*;
// rocket_codegen crate at all. Alas, doc-inlining will currently 1) show hidden
// proc-macros, and 2) result in proc-macros pointing to the wrong docs.
#[doc(hidden)] pub use rocket_codegen::*;
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate pear; #[macro_use] extern crate pear;

View File

@ -23,15 +23,32 @@ function relative() {
fi fi
} }
function future_date() {
local days_in_future=`[[ -z "$1" ]] && echo "0" || echo "$1"`
if date -v+1d +%Y-%m-%d > /dev/null 2>&1; then
echo $(date -v+${days_in_future}d +%Y-%m-%d)
elif date -d "+1 day" > /dev/null 2>&1; then
echo $(date '+%Y-%m-%d' -d "+${days_in_future} days")
else
echo "Error: need a 'date' cmd that accepts -v (BSD) or -d (GNU)"
exit 1
fi
}
# Versioning information. These are toggled as versions change. # Versioning information. These are toggled as versions change.
ROCKET_VERSION="0.5.0-dev"
CURRENT_RELEASE=false CURRENT_RELEASE=false
PRE_RELEASE=true PRE_RELEASE=true
# A generated codename for this version. Use the git branch for pre-releases. # A generated codename for this version. Use the git branch for pre-releases.
case $PRE_RELEASE in case $PRE_RELEASE in
true) VERSION_CODENAME="$(git branch --show-current)" ;; true)
false) VERSION_CODENAME="$(echo "${ROCKET_VERSION}" | cut -d'.' -f1-2)" ;; VERSION_CODENAME="$(git branch --show-current)"
ROCKET_VERSION="${VERSION_CODENAME}-$(future_date)"
;;
false)
ROCKET_VERSION="0.5.0-dev"
VERSION_CODENAME="$(echo "${ROCKET_VERSION}" | cut -d'.' -f1-2)"
;;
esac esac
# Root of workspace-like directories. # Root of workspace-like directories.
@ -77,4 +94,5 @@ if [ "${1}" = "-p" ]; then
echo "EXAMPLES_DIR: ${EXAMPLES_DIR}" echo "EXAMPLES_DIR: ${EXAMPLES_DIR}"
echo "DOC_DIR: ${DOC_DIR}" echo "DOC_DIR: ${DOC_DIR}"
echo "ALL_PROJECT_DIRS: ${ALL_PROJECT_DIRS[*]}" echo "ALL_PROJECT_DIRS: ${ALL_PROJECT_DIRS[*]}"
echo "date(): $(future_date)"
fi fi

View File

@ -20,7 +20,7 @@ fi
echo ":::: Generating the docs..." echo ":::: Generating the docs..."
pushd "${PROJECT_ROOT}" > /dev/null 2>&1 pushd "${PROJECT_ROOT}" > /dev/null 2>&1
RUSTDOCFLAGS="-Z unstable-options --crate-version ${ROCKET_VERSION}" \ RUSTDOCFLAGS="-Z unstable-options --crate-version ${ROCKET_VERSION}" \
cargo doc -p rocket -p rocket_contrib -p rocket_codegen --no-deps --all-features cargo doc -p rocket -p rocket_contrib --no-deps --all-features
popd > /dev/null 2>&1 popd > /dev/null 2>&1
# Blank index, for redirection. # Blank index, for redirection.

View File

@ -41,7 +41,6 @@ function ensure_tab_free() {
# Ensures there are no files with trailing whitespace. # Ensures there are no files with trailing whitespace.
function ensure_trailing_whitespace_free() { function ensure_trailing_whitespace_free() {
# FIXME: Some .stderr files contain trailing spaces
local matches=$(git grep -E -I "\s+$" "${PROJECT_ROOT}" | grep -v -F '.stderr:') local matches=$(git grep -E -I "\s+$" "${PROJECT_ROOT}" | grep -v -F '.stderr:')
if ! [ -z "${matches}" ]; then if ! [ -z "${matches}" ]; then
echo "Trailing whitespace was found in the following:" echo "Trailing whitespace was found in the following:"