mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
1431c2b408
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
25 lines
783 B
Groovy
25 lines
783 B
Groovy
import org.elasticsearch.gradle.OS
|
|
import org.elasticsearch.gradle.VersionProperties
|
|
import org.elasticsearch.gradle.info.BuildParams
|
|
|
|
apply plugin: 'elasticsearch.jdk-download'
|
|
|
|
jdks {
|
|
provisioned_runtime {
|
|
vendor = VersionProperties.bundledJdkVendor
|
|
version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase())
|
|
platform = OS.current().name().toLowerCase()
|
|
}
|
|
}
|
|
|
|
configure(allprojects - project(':build-tools')) {
|
|
project.tasks.withType(Test).configureEach { Test test ->
|
|
if (BuildParams.getIsRuntimeJavaHomeSet()) {
|
|
test.executable = "${BuildParams.runtimeJavaHome}/bin/java"
|
|
} else {
|
|
test.dependsOn(rootProject.jdks.provisioned_runtime)
|
|
test.executable = rootProject.jdks.provisioned_runtime.getBinJavaPath()
|
|
}
|
|
}
|
|
}
|