-
Notifications
You must be signed in to change notification settings - Fork 26
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
update asm for Java 19 support #220
Conversation
Thanks! |
Without the cast, it seems Groovy looks for a method taking Object[] as 3rd argument that is not defined in the abstract base class and results in NPE (java.lang.NullPointerException: Cannot invoke "groovy.lang.MetaMethod.isAbstract()" because "method" is null)
Ah, so it seems it's not just updating the ASM. The plugin builds, tests pass, but it still didn't work with JDK 19. So I tried to update the dependencies and make everything work with JDK 19 and Gradle 7.3+. I think Groovy and I will never be real close friends. I could not make the changes in a way that maintains compatibility with Gradle versions 4, 5, 6. That might not be acceptable for @siordache. Java 19 needs Gradle 7.3+, and I am no expert on this, but it seems that Gradle 7+ uses Groovy 3. So I have updated all plugins dependencies to current versions. I replaced the assembler with the one supplied by gradle. I think the original author decided to use an external asm to support newer JDK independent from older Gradle versions. However I could not get it to work and I really need a working plugin for JDK 19 and Gradle 7.3+ ASAP, so I took this route. I also removed all @CompileStatic annotations from the plugin code as that seemed to solve some problems. It might not have been necessary, as I could only get the plugin to work in Gradle 7.3+. I had to add a dependency for JUnit4 compatibility ("@rule" etc) and had to add "useJUnitPlatform()" in the build file because tests were not found. I have not yet tested the plugin with projects other than the supplied test projects. I will do ASAP and if it works, I might publish a Gradle7+ only version with other Gradle coordinates that might work for you. I don't know if/when the original plugin will be updated, but this really seems to be much more complicated than I thought at first, so I think it might take some time. If the changes I made help in the process, I will be glad. |
This looks like a pretty good change @xzel23 ! It seems like Gradle 7.6 will be the first version to support JDK 19: So Gradle 7.6+ will be needed in order to support JDK 19. |
@CodeDead no, gradle can run on jdk 17 and build a project using another jdk which is jdk 19. Gradle 7.6 will add support for running gradle on JDK 19, which is not needed. |
@CodeDead You can run Gradle on Java 17 and compile using Java 19 if you use the toolchain support like this:
|
One probably encounter the problem before realizing that badass jlink doesn't work with 19 lol |
@CodeDead Gradle will automatically download the correct JDK for the build if it isn't installed on the system. |
@xzel23 For automated builds Gradle would then automatically download and install some JDK for each build step of each build? Or is the downloaded JDK somehow cacheable? |
Thanks for the fast answer, that helped me make it work. One thing that is not mentioned there: Downloaded JDKs are cached in |
Gradle's new version 7.6 now supports jdk19 as well |
It's a shame that this PR is not receiving developers' input. We have a smol library that modifies the java bytecode's java major version so that badass jlink still thinks it's Java 17 (along with two more changes -- from |
Ohh! That's great! I take it all back. Nice job!! |
That's very sweet! 🆒🆒🆒 |
Finally! 🙄 |
@bxqgit I think we should be grateful and not post such comments. Providing and maintaining open source software can be a time consuming and tedious task, and it is most of the time unpaid. We all have our day jobs that we rely on to make a living. If you are unsatisfied with the progress, you can actively help by submitting your own PRs, or even step up and become a co-maintainer as @siordache recently asked for someone who could help out with this plugin. Or you could review PRs, and report or fix problems. Just replying "finally" is not motivating for the maintainer. Don't get me wrong, I can understand your feeling. But blaming the maintainer is not the right thing to do. |
fixes #219