Support newer Graalvm JDK 17 distributions #164
Merged
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 PR adds support for the new updates to the
setup-graalvm
github action which allows you to specify different graalvm distributions (i.e. graalvm, graalvm-community and mandrel), see https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later for more details.Rather than just using a raw string, this PR introduces a new trait called
Graalvm
which allows you to specify which format of the github action you want to use. It was done this way because thesetup-graalvm
github action doesn't allow using graalvm distributions for JDK versions older than 17. Basic validation for throwing exceptions was also added to verify this (i.e. you cannot useGraalvm.Distribution
if the JDK is older than 17).The final rendering of the github action is the same if you
Graalvm.Version
(i.e. currentJavaSpec.graalvm("22.3.0", "17")
renders the same as this PR'sJavaSpec.graalvm(Graalvm.Version("22.3.0"), "17")
but notJavaSpec.graalvm(Graalvm.Distribution("graalvm"), "17")
. The old version ofdef graalvm(graal: String, version: String): JavaSpec
was retained to not break current sbt project builds but its been marked as deprecated.Furthermore this PR updates
build.sbt
to use the newGraalvm.Distribution
so that we are testing our own dog food (i.e. just to make sure that this newsetup-graalvm
github action feature works).