Use compiler version for gradle code (#73777)

The minimum compiler version is that which we require a developer to use
when building Elasticsearch. This version is updated as newer versions
of Java are released. In contrast, the minimum runtime version is that
which Elasticsearch itself needs. In 7.x this is Java 8, and in master
this is Java 11. Historically the version we require for gradle code has
had to be the minimum runtime version since all the gradle code was
distributed for plugin developers.

Now that the external build tools is separated from our internal tools,
the internal tools are no longer bound by that runtime requirement.
Instead, they can use the latest Java, so that we can use new features
within our internal tools. This commit switches the source compatibiltiy
version for the internal build tools to use the minimum compiler version.
This commit is contained in:
Ryan Ernst 2021-06-04 14:33:46 -07:00 committed by GitHub
parent dc86babfe6
commit 30d88d3865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -165,9 +165,9 @@ if (JavaVersion.current() < JavaVersion.VERSION_11) {
throw new GradleException('At least Java 11 is required to build elasticsearch gradle tools')
}
def minRuntimeJava = JavaVersion.toVersion(file('src/main/resources/minimumRuntimeVersion').text)
targetCompatibility = minRuntimeJava
sourceCompatibility = minRuntimeJava
def minCompilerJava = JavaVersion.toVersion(file('src/main/resources/minimumCompilerVersion').text)
targetCompatibility = minCompilerJava
sourceCompatibility = minCompilerJava
sourceSets {
integTest {