frgaal icon indicating copy to clipboard operation
frgaal copied to clipboard

frgaal with gradle 7.x

Open errael opened this issue 2 years ago • 6 comments

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)
        ...

errael avatar Aug 24 '22 04:08 errael

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!

jtulach avatar Aug 24 '22 05:08 jtulach

Thanks Yarda. I've been training myself to use the wrapper, got a copy of gw to facilitate that. I added a note in https://github.com/gradle/gradle/issues/15942 so that searching for frgaal finds it. There's a comment https://github.com/TwoStone/gradle-eclipse-compiler-plugin/issues/13#issuecomment-995495607 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.

errael avatar Aug 24 '22 15:08 errael

Hi @jtulach, do you plan to support Gradle7?

konikvranik avatar Nov 07 '22 11:11 konikvranik

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

jtulach avatar Nov 08 '22 06:11 jtulach

@konikvranik take a look at https://github.com/gradle/gradle/issues/15942. You could give it a thumbs up, comment, argue the case...

errael avatar Nov 08 '22 15:11 errael

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

dukescript avatar May 31 '23 04:05 dukescript