Closed kennethjor closed 1 year ago
Is this a standard? If so then can you point us to documentation of lombok versions in build.gradle specifically?
It is not mentioned here: https://projectlombok.org/setup/gradle
@rarkins It's how you set up the Lombok Gradle plugin: https://docs.freefair.io/gradle-plugins/6.3.0/reference/#_lombok.
So this is about io.freefair.lombok-base
specifically and not lombok generally?
I'm not sure about this. Doesn't this mean we could end up with hundreds of similar ones like this if we go down this path? As in, anyone can publish a Gradle plugin and say "configure it with foo { ... }
and then people would ask Renovate to support foo
too?
Are there any stats available to support this, e.g.
io.freefair.lombok-base
is a very popular plugin, worthy of an exception, orOtherwise if the answer is "there are thousands of Gradle plugins with equal or less popularity as this" then we don't want thousands of feature requests to implement each one separately - we need something more generic.
@rarkins To be honest, I had a feeling there'd be some pushback on this one, as it is very specific.
I've worked with Java for a long time and I think I've encountered two or so Gradle plugins that could be configured in this way, Lombok being one of them. In my own subjective experience, I don't think it's common.
A workaround would be to use Lombok without the Gradle plugin and then Renovate would pick it up just fine.
So this is about
io.freefair.lombok-base
specifically and not lombok generally?
This is about the version of Lombok being set on the plugin config.
I had a look a the repo responsible for the Gradle plugin, and it looks like they have Dependabot running to update the default Lombok version. The reason I define the version directly is that I wanted to use the latest one and it wasn't the default in the plugin yet. It just became a habit.
The "official" workaround could thus be to just not define the version at all. I'd be happy with this.
If it's common for plugins to define a "short" config like this then we can consider supporting it, e.g. with a series of in-built mappings such as lombok->io.freefair.lombok-base. Are there any other plugins which do similarly?
The only one I can think of is Gradle itself, as mentioned over in https://github.com/renovatebot/renovate/issues/13251.
That's a different syntax though
Lombok is a widespread library in Java, and the developers recommended way to use it is by using the plugin because the plugin is also configuring some other things (ie: needed annotation processor)
Reproduction forked to https://github.com/renovate-reproductions/13333
@Churro do you have any thoughts on this?
This can be made working easily using a custom preset:
"regexManagers": [
{
"fileMatch": ["\\.gradle$"],
"matchStrings": ["lombok(?:\\s*\\{\\s*|\\.)version[ \\t]*=[ \\t]*[\"'](?<currentValue>.*?)[\"']"],
"datasourceTemplate": "maven",
"depNameTemplate": "org.projectlombok:lombok"
},
],
The pattern is admittedly ugly but works fine with the reproduction repo and also covers some nuances (different spaces, quotes), as well as the synonymous definition: lombok.version = "..."
If it's common for plugins to define a "short" config like this then we can consider supporting it, e.g. with a series of in-built mappings such as lombok->io.freefair.lombok-base. Are there any other plugins which do similarly?
Afaik, there are two kinds of plugins:
Custom gradle plugins like lombok that are configurable, like in this case the version
property. There is no way to cover all of them since its fully up to the plugin on what options they expose and how they are named.
Gradle-included plugins (overall ~10, I know about) like checkstyle, jacoco, pmd, codenarc, findbugs, etc. which can be configured similarly. E.g., for jacoco using toolVersion
. Mapping them to their Maven deps (checkstyle -> com.puppycrawl.tools:checkstyle, pmd -> net.sourceforge.pmd:pmd, etc.) would be possible.
I can think of two ways how to make this work out-of-the-box for popular (lombok) + Gradle-native plugins:
packageRules
. regexManager
would match versions of gradle plugins also if gradle manager itself is disabled. This would result in unexpected behavior IMHO.Thanks @Churro. In this case let's support common plugin cases like lombok natively in the gradle
manager.
:tada: This issue has been resolved in version 34.54.0 :tada:
The release is available on:
34.54.0
Your semantic-release bot :package::rocket:
What would you like Renovate to be able to do?
Update the version of Lombok (
org.projectlombok/lombok
) inside thebuild.gradle
configuration:The minimal repo can be found here: https://github.com/kennethjor/renovate-bot-lombok-plugin-minimal-repo
If you have any ideas on how this should be implemented, please tell us here.
I don't.
Is this a feature you are interested in implementing yourself?
No