-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Explicitly use JDK 17 through gradle toolchains #2572
Conversation
Gradle 8 not working is actually because of a bug in AGP that I believe is fixed in the next version so I decided to wait for the next AGP version instead. We don't really need Gradle 8 features right now. |
Do you want me to drop the gradle upgrade? |
I've read a bit about Gradle toolchains and I now agree that we should indeed start using them so everyone is always using the same JDK version. I'm not a fan of the duplicate configurations so my proposal is to either use the buildSrc folder or a |
1f8dc41
to
1398620
Compare
Sorry for the long wait. I didn't like the way this PR made it's changes, which is not your fault but just how Gradle works. I have a much simpler way to set the Java versions for the Kotlin&Android plugins from the root build file which I've pushed to the Renovate PR (#2495). I've also kept the target at Java 1.8 because older Android versions cannot read newer Java bytecode. Compiling with a newer Java version is fine though. If you'd like you can rebase this PR on top of master so we can still merge the changes for the shared Android SDK numbers (those would go in the main build file now) and possibly the toolchains too. My apologies for taking a few weeks and redoing the primary part of your PR. |
1398620
to
22a4c10
Compare
@nielsvanvelzen no problem, I understand gradle making things interesting The diff now boils down to:
So I just want to check if you want all of these commits, or if you want some dropped? |
22a4c10
to
41a80cc
Compare
Looks good, my only suggestion would be to not use the version catalog for those versions because they won't be updated by Renovate and they also need to be changed in the GH workflows when we update them. Putting something in the catalog creates the assumption that it's the "source of truth" (which it is for all other stuff right now). |
Do you want me to drop the commit moving them into the catalog, or put them somewhere else? |
Just leave both versions hardcoded in the build files |
41a80cc
to
0a67d3d
Compare
Explicitly mark that we want version 17 of the JDK as the compiler. Previously we implicitly relied on Gradle getting this right. This means devs and CI will all use the same JDK explicitly rather than implicitly. Pin the target JDK version in build.gradle.kts, this should apply to all targets (including Kotlin) to version 1.8 to maintain compatibility with older devices
0a67d3d
to
ecfb2c7
Compare
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.
Thanks!
Changes
Pins the implicit JDK version to 17 (based on our CI settings) to avoid gradle sync errors with 8.x
This is because Gradle has bumped the DSL to 1.8 with version 8.x, so it highlighted the implicit mismatch going on
Issues
Fixes #2495