Inline macro docs into core crate.

This commit is contained in:
Sergio Benitez 2020-02-25 16:56:59 -08:00
parent 0ecb50c3b5
commit ff535c2ff9
4 changed files with 24 additions and 6 deletions

View File

@ -97,7 +97,7 @@
//! [testing chapter of the guide]: https://rocket.rs/v0.4/guide/testing/#testing
#[allow(unused_imports)] #[macro_use] extern crate rocket_codegen;
#[doc(hidden)] pub use rocket_codegen::*;
pub use rocket_codegen::*;
extern crate rocket_http;
#[macro_use] extern crate log;

View File

@ -23,15 +23,32 @@ function relative() {
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.
ROCKET_VERSION="0.4.2"
CURRENT_RELEASE=true
PRE_RELEASE=false
# A generated codename for this version. Use the git branch for pre-releases.
case $PRE_RELEASE in
true) VERSION_CODENAME="$(git branch --show-current)" ;;
false) VERSION_CODENAME="$(echo "${ROCKET_VERSION}" | cut -d'.' -f1-2)" ;;
true)
VERSION_CODENAME="$(git branch --show-current)"
ROCKET_VERSION="${VERSION_CODENAME}-$(future_date)"
;;
false)
ROCKET_VERSION="0.4.2"
VERSION_CODENAME="$(echo "${ROCKET_VERSION}" | cut -d'.' -f1-2)"
;;
esac
# Root of workspace-like directories.
@ -77,4 +94,5 @@ if [ "${1}" = "-p" ]; then
echo "EXAMPLES_DIR: ${EXAMPLES_DIR}"
echo "DOC_DIR: ${DOC_DIR}"
echo "ALL_PROJECT_DIRS: ${ALL_PROJECT_DIRS[*]}"
echo "date(): $(future_date)"
fi

View File

@ -20,7 +20,7 @@ fi
echo ":::: Generating the docs..."
pushd "${PROJECT_ROOT}" > /dev/null 2>&1
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
# Blank index, for redirection.

View File

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