Skip to content
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

Support a feature flag to disable generating unchanged files #20

Open
elie321 opened this issue May 6, 2022 · 5 comments
Open

Support a feature flag to disable generating unchanged files #20

elie321 opened this issue May 6, 2022 · 5 comments

Comments

@elie321
Copy link

elie321 commented May 6, 2022

Every-time I generate JOOQ using the plugin, it generates unnecessary changes with new date and serialVersionUid.

These changes are superficial and I always end up inspecting them one by one and discarding them.

I am requesting a feature flag. When enabled, it would avoid generating these files (that has no real changes) and as a result wouldn't need committed.

@elie321
Copy link
Author

elie321 commented May 9, 2022

I may be missing something.
I pinned jooq 3.16.6 in gradle.
Im unable to find any feature to enable generating serialVersionUID as hash for example or as constant on the org.jooq.meta.jaxb.Generate object.

@lukaseder
Copy link

I'm not affiliated with this plugin, just thought this might help. From the readme, I'd expect the generate content to be available via customizeGenerator?

See: https://github.com/revolut-engineering/jooq-plugin/blob/master/README.md

@elie321
Copy link
Author

elie321 commented May 10, 2022

Yes, this is how I had a reference to the Generate object

tasks {
    generateJooqClasses {
        customizeGenerator {
            generate.examplePropertyName = exampleValue
        }
    }
}

to close the loop on this one, I was able to set the generatedSerialVersionUID via the withGroovyBuilder.
This is a decent work around.
I wasn't aware of this Groovy builder. But it seems like the Kotlin object doesn't expose certain properties? if that is the case , I feel like there's room for improvement (at least to enhance discoverability of these features/props).

tasks {
    generateJooqClasses {
        customizeGenerator {
            generate.examplePropertyName = exampleValue
            generate.withGroovyBuilder {
                setProperty("generatedSerialVersionUID", "HASH")
            }
        }
    }
}

Thank you! I appreciate your input and time.

@monosoul
Copy link

monosoul commented Jun 1, 2022

You can do it like that:

tasks {
    generateJooqClasses {
        customizeGenerator {
            generate.generatedSerialVersionUID = org.jooq.meta.jaxb.GeneratedSerialVersionUID.HASH
        }
    }
}

Btw, this plugin seems to be abandoned, so I forked it and published it under a new group. It's available here: https://plugins.gradle.org/plugin/dev.monosoul.jooq-docker ( https://github.com/monosoul/jooq-gradle-plugin )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants