diff --git a/build.gradle b/build.gradle index 791a80aa..ae02b089 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.19.0' classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.1.0' - classpath 'com.palantir.gradle.jdks:gradle-jdks:0.51.0' + classpath 'com.palantir.gradle.jdks:gradle-jdks:0.52.0' classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.16.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0' classpath 'com.palantir.gradle.revapi:gradle-revapi:1.8.0' diff --git a/gradle/gradle-jdks-setup.jar b/gradle/gradle-jdks-setup.jar index b6386839..f1b8b4d1 100644 Binary files a/gradle/gradle-jdks-setup.jar and b/gradle/gradle-jdks-setup.jar differ diff --git a/gradle/gradle-jdks-setup.sh b/gradle/gradle-jdks-setup.sh index f8cd6578..fe7d9122 100755 --- a/gradle/gradle-jdks-setup.sh +++ b/gradle/gradle-jdks-setup.sh @@ -74,6 +74,7 @@ gradle_daemon_jdk_distribution_local_path=$(read_value "$APP_GRADLE_DIR"/jdks/"$ "$GRADLE_JDKS_HOME"/"$gradle_daemon_jdk_distribution_local_path"/bin/java -cp "$APP_GRADLE_DIR"/gradle-jdks-setup.jar com.palantir.gradle.jdks.setup.GradleJdkInstallationSetup daemonSetup "$APP_HOME" "$GRADLE_JDKS_HOME/$gradle_daemon_jdk_distribution_local_path" # [Used by ./gradlew only] Setting the Gradle Daemon Java Home to the JDK distribution -set -- "-Dorg.gradle.java.home=$GRADLE_JDKS_HOME/$gradle_daemon_jdk_distribution_local_path" "$@" +export GRADLE_DAEMON_JDK="$GRADLE_JDKS_HOME/$gradle_daemon_jdk_distribution_local_path" +set -- "-Dorg.gradle.java.home=$GRADLE_DAEMON_JDK" "$@" cleanup diff --git a/gradlew b/gradlew index 6938ca3e..75d68b56 100755 --- a/gradlew +++ b/gradlew @@ -68,6 +68,8 @@ if [ -f gradle/gradle-jdks-setup.sh ]; then echo "Failed to set up JDK, running gradle/gradle-jdks-setup.sh failed with non-zero exit code" exit 1 fi + # Setting JAVA_HOME to the gradle daemon to make sure gradlew uses this jdk for `JAVACMD` + JAVA_HOME="$GRADLE_DAEMON_JDK" fi # <<< Gradle JDK setup <<< diff --git a/settings.gradle b/settings.gradle index 5defc7e1..8865a5f3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ buildscript { gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } } } dependencies { - classpath 'com.palantir.gradle.jdks:gradle-jdks-settings:0.51.0' + classpath 'com.palantir.gradle.jdks:gradle-jdks-settings:0.52.0' } } apply plugin: 'com.palantir.jdks.settings'