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

Provide demo that uses Gradle to run the code generator #13

Closed
digulla opened this issue Mar 18, 2024 · 1 comment
Closed

Provide demo that uses Gradle to run the code generator #13

digulla opened this issue Mar 18, 2024 · 1 comment

Comments

@digulla
Copy link

digulla commented Mar 18, 2024

All the existing demos use Maven to build.

I've run into several issues when trying to get the jOOQ code generator to work with Gradle + Kotlin scripts. My main issues:

  • The syntax in Gradle scripts is sometimes strange, so it would be great to have a working example to look at
  • The official documentation (https://www.jooq.org/doc/3.20/manual/code-generation/codegen-gradle/) is missing the "run the code gen before the compiler" part. I solved this with this code but I'm not sure whether this is a good solution and how/when it will break:
tasks.named("compileJava") {
    dependsOn += tasks.named("jooqCodegen")
}

Note: I'm generating Java code even for my Kotlin project. I'm already struggling with this and I don't want to add Kotlin compiler/setup issues to the mix.

If a demo is take too much time, then please at least mention how to make the link between the code gen and compiler on https://www.jooq.org/doc/3.20/manual/code-generation/codegen-gradle/

@lukaseder
Copy link
Member

Thanks for your report.

Adding gradle examples to the demo is already part of this task:

  • The syntax in Gradle scripts is sometimes strange, so it would be great to have a working example to look at

I'm assuming you're looking into the official gradle plugin from jOOQ 3.19, not any third party plugins. The manual is full of examples. Pick a random page, e.g.:

https://www.jooq.org/doc/3.20/manual/code-generation/codegen-advanced/codegen-config-database/codegen-database-forced-types/codegen-database-forced-types-converter/

Then click on the gradle tab:

image

There are a few missing sections (not just gradle), see e.g.:

What are you missing specifically?

Yes, see:

I'm closing this issue as a duplicate of the above.

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

No branches or pull requests

2 participants