Make new contrib libraries publishable.

This commit is contained in:
Sergio Benitez 2021-06-09 03:49:26 -07:00
parent fe16d11581
commit 394982edbd
5 changed files with 26 additions and 10 deletions

View File

@ -23,6 +23,7 @@ notify = "4.0.6"
normpath = "0.3" normpath = "0.3"
[dependencies.rocket] [dependencies.rocket]
version = "0.5.0-dev"
path = "../../core/lib" path = "../../core/lib"
default-features = false default-features = false

View File

@ -34,9 +34,11 @@ memcache = { version = "0.15", optional = true }
r2d2-memcache = { version = "0.6", optional = true } r2d2-memcache = { version = "0.6", optional = true }
[dependencies.rocket_sync_db_pools_codegen] [dependencies.rocket_sync_db_pools_codegen]
version = "0.1.0-dev"
path = "../codegen" path = "../codegen"
[dependencies.rocket] [dependencies.rocket]
version = "0.5.0-dev"
path = "../../../core/lib" path = "../../../core/lib"
default-features = false default-features = false

View File

@ -73,14 +73,23 @@ case $PRE_RELEASE in
;; ;;
esac esac
ALL_PROJECT_DIRS=( CORE_CRATE_ROOTS=(
"${CORE_HTTP_ROOT}" "${CORE_HTTP_ROOT}"
"${CORE_CODEGEN_ROOT}" "${CORE_CODEGEN_ROOT}"
"${CORE_LIB_ROOT}" "${CORE_LIB_ROOT}"
) )
CONTRIB_LIB_DIRS=( CONTRIB_SYNC_DB_POOLS_CRATE_ROOTS=(
"${CONTRIB_ROOT}/sync_db_pools" "${CONTRIB_ROOT}/sync_db_pools/lib"
"${CONTRIB_ROOT}/sync_db_pools/codegen"
)
ALL_CRATE_ROOTS=(
"${CORE_HTTP_ROOT}"
"${CORE_CODEGEN_ROOT}"
"${CORE_LIB_ROOT}"
"${CONTRIB_ROOT}/sync_db_pools/lib"
"${CONTRIB_ROOT}/sync_db_pools/codegen"
"${CONTRIB_ROOT}/dyn_templates" "${CONTRIB_ROOT}/dyn_templates"
) )
@ -103,8 +112,7 @@ function print_environment() {
echo " GUIDE_TESTS_ROOT: ${GUIDE_TESTS_ROOT}" echo " GUIDE_TESTS_ROOT: ${GUIDE_TESTS_ROOT}"
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_CRATE_ROOTS: ${ALL_CRATE_ROOTS[*]}"
echo " CONTRIB_LIB_DIRS: ${CONTRIB_LIB_DIRS[*]}"
echo " date(): $(future_date)" echo " date(): $(future_date)"
} }

View File

@ -30,21 +30,23 @@ bash "${SCRIPT_DIR}/test.sh" +stable --all --release
# Temporarily remove dev-dependencies so crates.io verifies. # Temporarily remove dev-dependencies so crates.io verifies.
echo ":::: Stripping [dev-dependencies]..." echo ":::: Stripping [dev-dependencies]..."
for dir in "${ALL_PROJECT_DIRS[@]}"; do for dir in "${ALL_CRATE_ROOTS[@]}"; do
strip_dev_dependencies "${dir}" strip_dev_dependencies "${dir}"
done done
# Publish all the things. # Publish all the things.
for dir in "${ALL_PROJECT_DIRS[@]}"; do for dir in "${ALL_CRATE_ROOTS[@]}"; do
pushd "${dir}" pushd "${dir}"
echo ":::: Publishing '${dir}'..." echo ":::: Publishing '${dir}'..."
# We already checked things ourselves. Don't spend time reverifying. # We already checked things ourselves. Don't spend time reverifying.
cargo publish --no-verify --allow-dirty ${@:1} cargo publish --no-verify --allow-dirty ${@:1}
# Give the index some time to update so the deps are there if we need them.
sleep 5
popd popd
done done
# Restore dev-dependencies. # Restore dev-dependencies.
echo ":::: Restoring [dev-dependencies]..." echo ":::: Restoring [dev-dependencies]..."
for dir in "${ALL_PROJECT_DIRS[@]}"; do for dir in "${ALL_CRATE_ROOTS[@]}"; do
restore_dev_dependencies "${dir}" restore_dev_dependencies "${dir}"
done done

View File

@ -161,8 +161,11 @@ print_environment
echo " CARGO: $CARGO" echo " CARGO: $CARGO"
echo " EXTRA FLAGS: $@" echo " EXTRA FLAGS: $@"
echo ":: Ensuring all crate versions match..." echo ":: Ensuring core crate versions match..."
check_versions_match "${ALL_PROJECT_DIRS[@]}" check_versions_match "${CORE_CRATE_ROOTS[@]}"
echo ":: Ensuring contrib sync_db_pools versions match..."
check_versions_match "${CONTRIB_SYNC_DB_POOLS_CRATE_ROOTS[@]}"
echo ":: Ensuring minimum style requirements are met..." echo ":: Ensuring minimum style requirements are met..."
check_style check_style