Separate minimum compiler and runtime Java version properties #79108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #78704 to additionally distinguish between minimum compiler version and minimum runtime versions of Java for the Elasticsearch project. The former is what we require you to run the build with. The latter is what we require you to run Elasticsearch with. These are also different for different build logic projects.
build-tools
is public, and used by folks to build plugins for Elasticsearch. Therefore, it should support the same minimum Java version as Elasticsearch does at runtime. That is, if you can run Elasticsearch 8.0 with Java 11, you should be able to build plugins using Java 11 across the board. In this case we want to target the minimum runtime version.build-tools-internal
is, obviously, internal. Since we generally force a higher minimum compiler version, this project can (and does) use newer Java APIs. In this case we want to target the minimum compiler version.This was actually causing compile errors in the IDE since we configure IntelliJ to compile with the
-release
flag but Gradle doesn't apply this to the build-tools projects. The alleviates the problem so we don't have a discrepancy between compile time and runtime Java requirements for thebuild-tools-internal
project.