mirror of https://github.com/rwf2/Rocket.git
Use 'compiletest' from git.
This commit is contained in:
parent
7971204dc2
commit
0645a50526
|
@ -19,7 +19,7 @@ rocket = { version = "0.3.17", path = "../lib/" }
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
compiletest_rs = { version = "0.3", features = ["stable"] }
|
compiletest_rs = { git = "https://github.com/laumann/compiletest-rs" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
yansi = "0.4"
|
yansi = "0.4"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
#
|
#
|
||||||
# Publishes the current versions of core, contrib, and codegen to crates.io.
|
# Publishes the current versions of all Rocket crates to crates.io.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Brings in: ROOT_DIR, EXAMPLES_DIR, LIB_DIR, CODEGEN_DIR, CONTRIB_DIR, DOC_DIR
|
# Brings in: ROOT_DIR, EXAMPLES_DIR, LIB_DIR, CODEGEN_DIR, CONTRIB_DIR, DOC_DIR
|
||||||
|
@ -14,17 +14,25 @@ if ! [ -z "$(git status --porcelain)" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function strip_dev_dependencies() {
|
||||||
|
perl -i.bak -p0e 's/\[dev-dependencies\][^\[]*//smg' "${1}/Cargo.toml"
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_dev_dependencies() {
|
||||||
|
mv "${1}/Cargo.toml.bak" "${1}/Cargo.toml"
|
||||||
|
}
|
||||||
|
|
||||||
# Ensure everything passes before trying to publish.
|
# Ensure everything passes before trying to publish.
|
||||||
echo ":::: Running test suite [debug]..."
|
echo ":::: Running test suite..."
|
||||||
cargo clean
|
cargo clean
|
||||||
bash "${SCRIPT_DIR}/test.sh"
|
bash "${SCRIPT_DIR}/test.sh"
|
||||||
|
bash "${SCRIPT_DIR}/test.sh --release"
|
||||||
|
|
||||||
echo ":::: Running test suite [release]..."
|
# Temporarily remove dev-dependencies so crates.io verifies.
|
||||||
cargo clean
|
echo ":::: Stripping [dev-dependencies]..."
|
||||||
bash "${SCRIPT_DIR}/test.sh" --release
|
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
||||||
|
strip_dev_dependencies "${dir}"
|
||||||
# Temporarily remove the dependency on codegen from core so crates.io verifies.
|
done
|
||||||
sed -i.bak 's/rocket_codegen.*//' "${LIB_DIR}/Cargo.toml"
|
|
||||||
|
|
||||||
# Publish all the things.
|
# Publish all the things.
|
||||||
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
||||||
|
@ -35,5 +43,8 @@ for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
||||||
popd
|
popd
|
||||||
done
|
done
|
||||||
|
|
||||||
# Restore the original core Cargo.toml.
|
# Restore dev-dependencies.
|
||||||
mv "${LIB_DIR}/Cargo.toml.bak" "${LIB_DIR}/Cargo.toml"
|
echo ":::: Restoring [dev-dependencies]..."
|
||||||
|
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
|
||||||
|
restore_dev_dependencies "${dir}"
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue