-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provision the correct JDK for test tasks (#48561)
This PR adds build configuration to use the `jdk-download` plugin with unit tests when no runtime java is configured externally. It's a first part in a longer chain of changes described in #40531.
- Loading branch information
Showing
6 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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() | ||
} | ||
} | ||
|
||
allprojects { | ||
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() | ||
} | ||
} | ||
} |