From c68987b27cd50743efa823bedb33368d97e4df1d Mon Sep 17 00:00:00 2001 From: Alex Semin Date: Thu, 9 Feb 2023 17:49:10 +0100 Subject: [PATCH] Improve collector script --- collect-trace.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/collect-trace.sh b/collect-trace.sh index fb2362b..f80b259 100755 --- a/collect-trace.sh +++ b/collect-trace.sh @@ -21,13 +21,21 @@ EMPTY_GRADLE_HOME="${EMPTY_GRADLE_HOME:-fresh-gradle-home}" GRADLE_CMD="$GRADLE_CMD -g $EMPTY_GRADLE_HOME" +# Ignore dependency verification +GRADLE_CMD="$GRADLE_CMD --dependency-verification lenient" + # Make sure no local artifact transform results are present # shellcheck disable=SC2086 exe $GRADLE_CMD --console=plain clean # Kill all Gradle daemons to make sure nothing is cached in memory -WRAPPER_VERSION="$($GRADLE_CMD --version | grep 'Gradle ' | awk '{print $2}')" -exe pkill -f "GradleDaemon $WRAPPER_VERSION" || true +exe pkill -f "GradleDaemon" +sleep 3 + +# Killing only daemons of the same version may not be enough, if other daemons hold locks on the fresh Gradle home somehow +#WRAPPER_VERSION="$($GRADLE_CMD --version | grep 'Gradle ' | awk '{print $2}')" +#exe pkill -f "GradleDaemon $WRAPPER_VERSION" || true + # Clean the temporary Gradle home to make sure artifact transform results are not cached on disk exe rm -rf "./$EMPTY_GRADLE_HOME/daemon" @@ -41,7 +49,7 @@ exe rm -rf "$STORAGE_DIR" # shellcheck disable=SC2086 exe $GRADLE_CMD --console=plain --no-build-cache "$TASK" \ -Dorg.gradle.internal.operations.trace="$STORAGE_DIR/$TRACE_PREFIX" \ - --scan -Dscan.dump + --scan -Dscan.dump -S # Find and move scan dump # https://unix.stackexchange.com/a/305846