From f3ace5e71d9e1c9b41c6fe4da6b39af241829f59 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 18 Oct 2019 11:10:15 +0700 Subject: [PATCH] build: use shared target dir --- ci/base-tests.sh | 8 +++++--- ci/integration-tests.sh | 3 +++ util/dev | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ci/base-tests.sh b/ci/base-tests.sh index 3fe0f174535..df53b6b5044 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -ex +# for faster build, share target dir between subcrates +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR + echo "Running clippy base tests" PATH=$PATH:./node_modules/.bin @@ -10,9 +14,7 @@ fi # build clippy in debug mode and run tests cargo build --features "debugging deny-warnings" cargo test --features "debugging deny-warnings" -# for faster build, share target dir between subcrates -CARGO_TARGET_DIR=$(pwd)/target/ -export CARGO_TARGET_DIR + (cd clippy_lints && cargo test) (cd rustc_tools_util && cargo test) (cd clippy_dev && cargo test) diff --git a/ci/integration-tests.sh b/ci/integration-tests.sh index 6ba9a284c50..651710b83ec 100755 --- a/ci/integration-tests.sh +++ b/ci/integration-tests.sh @@ -5,6 +5,9 @@ if [[ -z "$INTEGRATION" ]]; then exit 0 fi +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR + rm ~/.cargo/bin/cargo-clippy cargo install --force --debug --path . diff --git a/util/dev b/util/dev index 4fa6e69b752..8e3ed97f98d 100755 --- a/util/dev +++ b/util/dev @@ -1,3 +1,5 @@ #!/bin/sh +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR -cd clippy_dev && cargo run -- $@ +cd clippy_dev && cargo run -- "$@"