Integrade gradle toolchain to manage java versions #985
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.
Executing the build (e.g. using gradle check) will now handle several things for you and others running your build:
Almost every newcomer had issues with setting up our project, mainly because of java version mismatches, gradle and java compiler configurations. This is an attempt to eliminate these barariers, and streamline the experience for newcomers. With this PR, you don't even need to have java installed, it will do it for you, and it will download the correct matching version.
Since this is not a new feature anymore, I hope IDEs and other developer tooling started to respect and use these preferences from gradle, because last time I checked, intelliJ didn't support is fully, witch means you would still need to configure your IDE environment if you are launching our bot from there.
Old way of pegging the version with
sourceCompatibility = JavaVersion.VERSION_21
is considered deprecated by gradle. Also, it will only download correct jdk if you don't already have it. It's pereference when autoprovisioning is adoptium releases. We can force specific vendor if we want, for the whole project.