Skip to content
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

frgaal with gradle 7.x #6

Open
errael opened this issue Aug 24, 2022 · 6 comments
Open

frgaal with gradle 7.x #6

errael opened this issue Aug 24, 2022 · 6 comments

Comments

@errael
Copy link
Contributor

errael commented Aug 24, 2022

I'm new to frgaal and gradle. I've just gotten my 20+ year old project ported to gradle 7.5 from ant (decided to skip maven) and am hoping I won't feel the need to modernize its build system again before I die. I have heard, and now see, that gradle is a moving target; using the latest gradle I'd hoped to minimize the work of keeping up.

Tried frgaal with the gradle project and I'm getting weird stuff. Looking at the frgaal doc, and reading more carefully, it says works with 6.8.x. When I first read that last week, I assumed that was a minimum gradle; guess I was wrong. I thought the problem might be toolchains, and was surprised to see that toolchains were a part of 6.8 as well.

Is there a chance over the next few months of getting frgaal to work with 7.x? (at least where x==5). I'm having enough difficulty wrapping my head around the whole gadle/groovy DSL thing; not sure I'd be much help/use; but if I can assist...

Using gradle init for a lib project, flipped between 7.5.1 and 6.8.3 to demonstrate the problem. In case this is of use


* What went wrong:
org/gradle/jvm/internal/toolchain/JavaToolChainInternal

* Exception is:
java.lang.NoClassDefFoundError: org/gradle/jvm/internal/toolchain/JavaToolChainInternal
        at org.frgaal.gradle.FrgaalCompilerPlugin.apply(FrgaalCompilerPlugin.java:32)
        at org.frgaal.gradle.FrgaalCompilerPlugin.apply(FrgaalCompilerPlugin.java:29)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
        at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
        ...
@jtulach
Copy link

jtulach commented Aug 24, 2022

Hello Ernie. Choosing Gradle when looking for stability isn't going to play nicely. Gradle is known for being aggresive when deprecating and removing features. If you want some stability then never forget to add gradle wrapper.

All my projects that want to use Frgaal just fix the Gradle version in the wrapper to 6.8.x and then the compilation works. I find it ridiculous I cannot be on the latest version, but apparently wrapper (and not being on the latest) is the only approach to reach stability in the Gradle world.

As far as I know the case of JavaToolChainInternal follows the same pattern. Gradle had some semi-public API, they decided to remove with, but apparently without any sufficient replacement. Frgaal isn't the only compiler that doesn't have support for latest Gradle. Neither ecj has integration with the Gradle 7.x series.

project ported to gradle 7.5 from ant (decided to skip maven)

Skipping Maven? Well, then welcome to the Ant age again!

@errael
Copy link
Contributor Author

errael commented Aug 24, 2022

Thanks Yarda. I've been training myself to use the wrapper, got a copy of gw to facilitate that. I added a note in gradle/gradle#15942 so that searching for frgaal finds it. There's a comment TwoStone/gradle-eclipse-compiler-plugin#13 (comment) sketching a fragile workaround used with ecj. I'd rather wait for Gradle 8; any idea if a new JavaCompiler API is on the radar of the gradle team?

Oh well, backewards to 6.8.x; I liked the libs.versions.toml, wonder how that's done with 6.8, I'll find out.

@konikvranik
Copy link

Hi @jtulach, do you plan to support Gradle7?

@jtulach
Copy link

jtulach commented Nov 8, 2022

Has Gradle finally created a toolchain API that would work? Is there an example to copy? Then supporting Gradle 7 would be easy.

@errael
Copy link
Contributor Author

errael commented Nov 8, 2022

@konikvranik take a look at gradle/gradle#15942. You could give it a thumbs up, comment, argue the case...

@dukescript
Copy link
Collaborator

There is a new development on the Gradle side: gradle/gradle#24072 - anyone willing to experiment with Gradle 8 and Frgaal and share the findings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants