-
Notifications
You must be signed in to change notification settings - Fork 36
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
Plan for Gradle 7 release #215
Comments
@boris-petrov I got quite the opposite vibe from #214 (comment) 🤷 We might be able to use the same Gretty sources to compile with Groovy 2 and 3, but if they are binary incompatible, I do not see a way around different artifacts / variants containing different class files for the respective Groovy versions. |
@f4lco - I just ran our app on Gradle 7 RC 2 with Gretty 3.0.4. It ran fine. I saw it was using Groovy |
@boris-petrov unsure, depends on what you mean by "using". Yes, it might be possible that Groovy 2 was still on the classpath. And maybe that's also a future topic, not of immediate relevance: Groovy 3 might diverge more in the future, increasing the incompatibilities with Groovy 2, and as @chali pointed out, Gradle may have different requirements in the future. |
I'm also not sure what I mean. 😄 When I run
It's the same on Gradle 6.8.3 and on Gradle 7 RC 2. This is at compile-time though... not sure about runtime. And I don't even understand where this Groovy version comes from... but in any case Gretty seems to work fine. As for what you say about Groovy 3 diverging - that's for sure the case. For now we're lucky that Gretty (built with Gradle 6) seems to work just fine on both Gradle 6 and 7 so that's that. When that stops being the case - hopefully not in the next few months - we'll drop support for Gradle 6 and call it a day. :) Are you fine with that? |
@boris-petrov @f4lco to clarify my comments and concerns a bit. I was able to use a plugin published with Gradle 6 and compiled with Groovy 2 in Gradle 7 projects. There might be some changes required but it worked. My concern is that if a plugin project will move to Gradle 7 itself it will cause to produce groovy 3 compiled code and it will not work if this plugin is applied in Gradle 6 consumer. A concrete example. If you release Gretty plugin with Gradle 6 consumers should be able to use it a Gradle 7 projects. If you release Gretty with Gradle 7 it won't be possible. There is a hidden relationship between the Gradle version used in Gretty project itself and what is the compatibility of the produced plugin. I found that it is possible to make Groovy 3 compiled code runnable with Groovy 2 but it is very tedious work. You basically have to write Java instead of Groovy. |
OK thanks @chali for clearing this up. So I'll close this one: there's not much to plan or to do for the Gradle 7 release. My final takeaway is that once we move to Gradle 7, compile using Groovy 3, and publish that, we immediately discontinue support for Gradle 6.x (at least without investing a huge amount of work). That's something to keep in mind. Up to that point, the current setup serves us well: it guards against regressions for both Gradle versions, and publishes a plugin with good compatibility.
That's fine, we just should be aware of the implications. |
#214 has introduced a build job that guards against regressions with the Gradle 7 release candidate. The PR has also removed the hard-coded version of Groovy, which allows to re-use the same plugin sources for building against both Groovy 2 (Gradle 6) and Groovy 3 (Gradle 7). However, as @chali points out, this may not allow to actually publish and use the compiled plugin artifacts from within the same build job because of the binary incompatibility of Groovy 2 and 3.
Likely, we need to resort to publishing several plugin variants, which is in principle possible using experimental Gradle features as described in the Gradle 7 RC 1 documentation.
TL;DR: With advent of the new Gradle version, we need to publish several artifacts with different binary compatibility wrt Groovy, because likely we cannot drop Gradle 6 support immediately. Within this ticket, we should settle on a way to do it, and also adjust Gretty's build process.
The text was updated successfully, but these errors were encountered: