Closed clay-golem closed 2 years ago
I have the same issue - what are the odds that this will be updated?
It looks like the io.freefair
plugin has deprecated its support for generating lombok configs, and instead moved to a model where it checks that the user has supplied a config that's compatible with each other tool that it supports, and warns the user off if not.
Our previous approach was a bit of a hack: the CF has the same requirements (the presence of the lombok.addLombokGeneratedAnnotation = true
key) as a supported tool (Jacoco), so we called into the lombok plugin and asked it to configure itself for Jacoco.
I see a few possible ways forward for us:
io.freefair
plugin deprecated it for some reason, and I trust their judgment on how to handle lombok.io.freefair
plugin now does. We could do this by calling into their (private) methods again, but that will leave us open to this kind of problem again in the future. Or, we could implement the same functionality ourselves (but again I'd prefer not to do that, because we aren't the lombok experts).io.freefair
plugin version: if the version is old enough to support config generation, do that; otherwise, issue the above error.I'd like to think about this a bit (and get any input from those of you who've experienced the problem - sorry about that!), but I'm currently leaning towards either the 2nd option (i.e. calling their new private methods) or the last option. What do you think?
My hot take prefers the second option.
I agree with @mernst.
Perhaps working directly with the Lombok team to have them publish their private methods to a public API so that you can leverage it?
Interestingly, the Lombok plugin authors removed their support for approach 2 in https://github.com/freefair/gradle-plugins/commit/fdcf57648794eecea3151a2fb4a6e8db5f1f855c, which they merged two days ago (i.e. while we were having this conversation). Their motivation appears to be that some of their users considered it too naggy: https://github.com/freefair/gradle-plugins/issues/383.
Given that they removed support for checking Lombok configs at all, I think we should follow suit. I've opened a PR to do so: #170. That PR keeps our behavior the same (i.e. generate a Lombok config) if the version of the Lombok plugin is a 5.x version or lower. If the version is 6.x or larger, we issue an INFO level nag message, which most users won't see unless they look for it. I'm not thrilled with that choice (it corresponds to 4, but given the feedback from @iplantemn about error messages, I tried to avoid issuing a warning unless the user is looking at a higher logging level than normal).
In the latest release of the LombokPlugin - 6.0.0-m2, the method
LombokPlugin#configureForJacoco()
has been removed in this commit: https://github.com/freefair/gradle-plugins/commit/146498d103e2928f0dc17c4981c75a5088a3afc8It was a private method, but is still used here: https://github.com/kelloggm/checkerframework-gradle-plugin/blob/def758bc02a10b13596134922129ecc7ca8354f5/src/main/groovy/org/checkerframework/gradle/plugin/CheckerFrameworkPlugin.groovy#L109
Note that the
6.0.0-m2
is a pre-release.