Push runtime Java home through to Gradle

We need to start Gradle on the same JVM as runtime Java home to ensure
that certain tasks (e.g., third party audit) are run on all the flavors
of the JDK that we support (without this change it would only run on the
same JVM as Gradle which would usually be compiler Java home).

Relates elastic/x-pack-elasticsearch#3588

Original commit: elastic/x-pack-elasticsearch@d5f6a54fbe
This commit is contained in:
Jason Tedor 2018-01-16 22:55:26 -05:00 committed by GitHub
parent b0552e1c6e
commit 7ca8b72f97

View File

@ -174,9 +174,10 @@ echo "Running in $PWD"
set -xuf
# clean
./gradlew --stacktrace clean
./gradlew --stacktrace clean -Dorg.gradle.java.home=${RUNTIME_JAVA_HOME:-$JAVA_HOME}
# Actually run the tests
GRADLE_CLI_ARGS+=("-Dorg.gradle.java.home=${RUNTIME_JAVA_HOME:-$JAVA_HOME}")
./gradlew "${GRADLE_CLI_ARGS[@]}"
# write the ES hash we checked out to build metadata