|
19 | 19 | package org.elasticsearch.gradle
|
20 | 20 |
|
21 | 21 | import com.carrotsearch.gradle.junit4.RandomizedTestingTask
|
22 |
| -import nebula.plugin.extraconfigurations.ProvidedBasePlugin |
23 | 22 | import org.apache.tools.ant.taskdefs.condition.Os
|
24 | 23 | import org.eclipse.jgit.lib.Constants
|
25 | 24 | import org.eclipse.jgit.lib.RepositoryBuilder
|
@@ -58,9 +57,6 @@ import java.time.ZonedDateTime
|
58 | 57 | */
|
59 | 58 | class BuildPlugin implements Plugin<Project> {
|
60 | 59 |
|
61 |
| - static final JavaVersion minimumRuntimeVersion = JavaVersion.VERSION_1_8 |
62 |
| - static final JavaVersion minimumCompilerVersion = JavaVersion.VERSION_1_10 |
63 |
| - |
64 | 60 | @Override
|
65 | 61 | void apply(Project project) {
|
66 | 62 | if (project.pluginManager.hasPlugin('elasticsearch.standalone-rest-test')) {
|
@@ -95,6 +91,12 @@ class BuildPlugin implements Plugin<Project> {
|
95 | 91 | /** Performs checks on the build environment and prints information about the build environment. */
|
96 | 92 | static void globalBuildInfo(Project project) {
|
97 | 93 | if (project.rootProject.ext.has('buildChecksDone') == false) {
|
| 94 | + JavaVersion minimumRuntimeVersion = JavaVersion.toVersion( |
| 95 | + BuildPlugin.class.getClassLoader().getResourceAsStream("minimumRuntimeVersion").text.trim() |
| 96 | + ) |
| 97 | + JavaVersion minimumCompilerVersion = JavaVersion.toVersion( |
| 98 | + BuildPlugin.class.getClassLoader().getResourceAsStream("minimumCompilerVersion").text.trim() |
| 99 | + ) |
98 | 100 | String compilerJavaHome = findCompilerJavaHome()
|
99 | 101 | String runtimeJavaHome = findRuntimeJavaHome(compilerJavaHome)
|
100 | 102 | File gradleJavaHome = Jvm.current().javaHome
|
@@ -192,10 +194,12 @@ class BuildPlugin implements Plugin<Project> {
|
192 | 194 | project.rootProject.ext.runtimeJavaVersion = runtimeJavaVersionEnum
|
193 | 195 | project.rootProject.ext.javaVersions = javaVersions
|
194 | 196 | project.rootProject.ext.buildChecksDone = true
|
| 197 | + project.rootProject.ext.minimumCompilerVersion = minimumCompilerVersion |
| 198 | + project.rootProject.ext.minimumRuntimeVersion = minimumRuntimeVersion |
195 | 199 | }
|
196 | 200 |
|
197 |
| - project.targetCompatibility = minimumRuntimeVersion |
198 |
| - project.sourceCompatibility = minimumRuntimeVersion |
| 201 | + project.targetCompatibility = project.rootProject.ext.minimumRuntimeVersion |
| 202 | + project.sourceCompatibility = project.rootProject.ext.minimumRuntimeVersion |
199 | 203 |
|
200 | 204 | // set java home for each project, so they dont have to find it in the root project
|
201 | 205 | project.ext.compilerJavaHome = project.rootProject.ext.compilerJavaHome
|
@@ -348,7 +352,7 @@ class BuildPlugin implements Plugin<Project> {
|
348 | 352 | // just a self contained test-fixture configuration, likely transitive and hellacious
|
349 | 353 | return
|
350 | 354 | }
|
351 |
| - configuration.resolutionStrategy { |
| 355 | + configuration.resolutionStrategy { |
352 | 356 | failOnVersionConflict()
|
353 | 357 | }
|
354 | 358 | })
|
|
0 commit comments