-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Set the target JVM to 11 #8403
Conversation
Configure Gradle to build class files compatible with Java 11. This allows to use the published ORT artifacts also in Projects that use Java 11. Previously, Java 17 was required. The main use case for this is to be able to build the Analyzer Docker image for the ORT Server [1] with Java 11 which is required to analyze Gradle projects that are not compatible with newer Java versions. Relates to #8249. [1]: https://github.com/eclipse-apoapsis/ort-server Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
0371986
to
4515c14
Compare
.getOrDefault(enumValues<JvmTarget>().max()) | ||
val jvmTargetCompatibility = JvmTarget.JVM_11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sschuberth Does it make sense to keep the logic to determine the max version and use different versions for source and target or should we just hard code both to Java 11?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. As IIRC the JVM source compatibility is only also set to avoid the warning mentioned in https://youtrack.jetbrains.com/issue/KT-48745, we probably should just hard-code it. Or yet better, do as advised in this comment and use Gradle's toolchains mechanism with version 11 hard-coded there.
If you want to, I can take over the task to refactor this PR accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please go ahead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sschuberth Any chance we can get this change into tomorrow's release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my goal, yes, and I'm on it. Just learned a few unexpected things about Gradle toolchains that require me to think about it a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #8411, which I propose to use instead of this PR.
Configure Gradle to build class files compatible with Java 11. This allows to use the published ORT artifacts also in Projects that use Java 11. Previously, Java 17 was required.
The main use case for this is to be able to build the Analyzer Docker image for the ORT Server 1 with Java 11 which is required to analyze Gradle projects that are not compatible with newer Java versions.
Relates to #8249.