The test task is configured to use the runtime java version, but there are issues with the version of groovy used by gradle pre 6.0. In order to workaround this, we use the Gradle JDK to execute the build-tools tests. Closes #49404 Closes #49253
This commit is contained in:
parent
0c4491964b
commit
1431c2b408
|
@ -17,6 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.gradle.internal.jvm.Jvm
|
||||||
import org.gradle.util.GradleVersion
|
import org.gradle.util.GradleVersion
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
@ -225,8 +226,13 @@ if (project != rootProject) {
|
||||||
}
|
}
|
||||||
check.dependsOn(integTest)
|
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.
|
* comes from the java-gradle-plugin.
|
||||||
*/
|
*/
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
|
|
@ -12,16 +12,13 @@ jdks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
configure(allprojects - project(':build-tools')) {
|
||||||
if (project.path != ":build-tools") {
|
project.tasks.withType(Test).configureEach { Test test ->
|
||||||
// Build tools doesn't support java 8 still used in CI
|
if (BuildParams.getIsRuntimeJavaHomeSet()) {
|
||||||
project.tasks.withType(Test).configureEach { Test test ->
|
test.executable = "${BuildParams.runtimeJavaHome}/bin/java"
|
||||||
if (BuildParams.getIsRuntimeJavaHomeSet()) {
|
} else {
|
||||||
test.executable = "${BuildParams.runtimeJavaHome}/bin/java"
|
test.dependsOn(rootProject.jdks.provisioned_runtime)
|
||||||
} else {
|
test.executable = rootProject.jdks.provisioned_runtime.getBinJavaPath()
|
||||||
test.dependsOn(rootProject.jdks.provisioned_runtime)
|
|
||||||
test.executable = rootProject.jdks.provisioned_runtime.getBinJavaPath()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue