0

I would like to run the generateJooq gradle task automatically whenever Renovate updates the jOOQ version.

I use jOOQ in my Java project. When Renovate updates it, the library's version is changed, but all auto-generated jOOQ classes are not refreshed. Renovate creates a commit that changes the library but doesn't change the code. As a result, the code is generated when I run first generateJooq or build after jOOQ's update. It's inconvenient because database changes are added to some next commit which has nothing to do with the database. It would be more concise if auto-generated classes are updated in Renovate's commit.

The problem would be solved e.g. if the gradle task generateJooq is run whenever Renovate updates jOOQ. I haven't found such an option in Renovate's documentation.

1 Answers1

0

If you turn on the <generatedAnnotation> flag to produce a @Generated annotation, you can quickly compare its jOOQ version value with the Constants.VERSION value of the jOOQ library:

@Generated annotation example:

@Generated(
    value = {
        "https://www.jooq.org",
        "jOOQ version:3.19.0-SNAPSHOT"
    },
    comments = "This class is generated by jOOQ"
)

Constants content:

public final class Constants {
    // ...

    public static final String VERSION        = "3.19.0-SNAPSHOT";
}

I'm not sure if there's any automated way of doing this already, but it should be simple to quickly script this in Gradle. If you're using this third party plugin, you might be able to leverage its Gradle task dependency integration to automate this further, without introspecting actual generated code.

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509