fix: bring back Java 8 compatibility#267
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
065d56e to
e0c69ff
Compare
| } | ||
|
|
||
| dependencies { | ||
| implementation fileTree(dir: 'libs', include: ['*.jar']) |
There was a problem hiding this comment.
Wasn't used and AFAIK is considered a bad practice because makes the build less deterministic
There was a problem hiding this comment.
Yes, that should rather not be on the Gradle file.
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| java-version: '21' |
There was a problem hiding this comment.
As a bonus, you should be able to use latest version to compile the project, there is no reason to stick to an old java for the build 🤷
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| sourceCompatibility = JavaVersion.VERSION_11 |
There was a problem hiding this comment.
I tested that you could even do 1.8, but it is deprecated to compile for java 8 with latest java versions 🤷
Java compiler version 21 has deprecated support for compiling with source/target version 8.
Try one of the following options:
1. [Recommended] Use Java toolchain with a lower language version
2. Set a higher source/target version
3. Use a lower version of the JDK running the build (if you're not using Java toolchain)
For more details on how to configure these settings, see https://developer.android.com/build/jdks.
To suppress this warning, set android.javaCompile.suppressSourceTargetDeprecationWarning=true in gradle.properties.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Targeting java 11 is still a behavior change but will work for my project since, but from what I've seen a lot of projects still target java 1.8 🤷
There was a problem hiding this comment.
Can we try with Java 1.8 instead? A deprecation is the code is fine, we can keep it in mind for upcoming version bumps.
e0c69ff to
a83c21e
Compare
## [5.1.1](v5.1.0...v5.1.1) (2024-07-09) ### Bug Fixes * bring back Java 8 compatibility ([#267](#267)) ([fded4c0](fded4c0))
|
🎉 This PR is included in version 5.1.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #266 🦕