diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 934990a1dbc52..49edf5581d6ff 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -17,6 +17,7 @@ * under the License. */ +import org.gradle.internal.jvm.Jvm import org.gradle.util.GradleVersion plugins { @@ -223,8 +224,13 @@ if (project != rootProject) { } check.dependsOn(integTest) + // for now we hardcode the tests for our build to use the gradle jvm. + tasks.withType(Test).configureEach { + it.executable = Jvm.current().getJavaExecutable() + } + /* - * We alread configure publication and we don't need or want this one that + * We already configure publication and we don't need or want this one that * comes from the java-gradle-plugin. */ afterEvaluate { diff --git a/gradle/runtime-jdk-provision.gradle b/gradle/runtime-jdk-provision.gradle index e67d1d44f507c..e05da2d47c5a6 100644 --- a/gradle/runtime-jdk-provision.gradle +++ b/gradle/runtime-jdk-provision.gradle @@ -12,7 +12,7 @@ jdks { } } -allprojects { +configure(allprojects - project(':build-tools')) { project.tasks.withType(Test).configureEach { Test test -> if (BuildParams.getIsRuntimeJavaHomeSet()) { test.executable = "${BuildParams.runtimeJavaHome}/bin/java" @@ -21,4 +21,4 @@ allprojects { test.executable = rootProject.jdks.provisioned_runtime.getBinJavaPath() } } -} \ No newline at end of file +}