Thanks a lot for sharing your update. I'll be curious how it will get adopted :)
Cheers, Lukas On Sat, Oct 26, 2019 at 4:12 AM Bombinating Dev <[email protected]> wrote: > The major different between the two plugins is > that dev.bombinating.jooq-codegen supports the Gradle Kotlin DSL [1]. > > There was a request to the support it in the nu.studer.jooq plugin but it > was turned down [2] > <https://github.com/etiennestuder/gradle-jooq-plugin/pull/91> > > I think the dev.bombinating.jooq-codegen plugin is slightly simpler to use > because: > > (1) it makes the jOOQ Configuration object easy and type-safe to configure > using Kotlin extension functions; > (2) it doesn't make the jOOQ code generation a dependency for Java > compilation; > (3) jOOQ code generation tasks are declared using the regular Gradle DSL > rather than being defined in the plugin extension > > Finally, I think the logging support, showing what is happening with the > jOOQ code generator, is quite good too :) > > Thanks > > [1] https://docs.gradle.org/current/userguide/kotlin_dsl.html > [2] https://github.com/etiennestuder/gradle-jooq-plugin/pull/91 > > On Fri, Oct 25, 2019 at 2:33 PM Lukas Eder <[email protected]> wrote: > >> Hi there, >> >> Thanks a lot for sharing your contribution here. >> How does it compare to the one we recommend, officially? >> https://github.com/etiennestuder/gradle-jooq-plugin >> >> Thanks, >> Lukas >> >> On Wed, Oct 23, 2019 at 2:46 PM Bombinating Dev < >> [email protected]> wrote: >> >>> Announcing a new jOOQ Gradle code generation plugin that supports the >>> Gradle Kotlin DSL [1]: https://github.com/bombinating/jooq-gradle-plugin >>> >>> The plugin allows you to define the jOOQ codegen config within a >>> build.gradle.kts file and invoke it as a Gradle task. >>> >>> (Note that the generated code is still Java; this plugin just makes it >>> easier to configure and invoke the jOOQ code generator from within a >>> build.gradle.kts script.) >>> >>> To use the plugin, first apply it in your build.gradle.kts script: >>> >>> plugins { >>> id("dev.bombinating.jooq-codegen") version "1.3.0" >>> } >>> >>> >>> Then, create a variable for the directory the code will be generated >>> into and add this directory to the source set: >>> >>> val genDir = "$projectDir/generated/src/main/java" >>> sourceSets["main"].java { >>> srcDirs(genDir) >>> } >>> >>> >>> Next, specify the JDBC driver that jOOQ will need to introspect the DB >>> in the jooqRuntime dependency: >>> >>> dependencies { >>> compile(group = "org.jooq", name = "jooq", version = "3.12.1") >>> jooqRuntime(group = "com.h2database", name = "h2", version = >>> "1.4.199") >>> } >>> >>> >>> Finally, define the jOOQ code generation configuration: >>> >>> jooq { >>> version = "3.12.2" >>> edition = JooqEdition.OpenSource >>> jdbc { >>> url = "jdbc:h2:./build/db/test_db;AUTO_SERVER=true" >>> username = "sa" >>> password = "" >>> } >>> generator { >>> database { >>> includes = ".*" >>> } >>> target { >>> directory = genDir >>> packageName = "dev.bombinating.db" >>> } >>> } >>> } >>> >>> >>> The task created by the extension above can be invoked as: >>> >>> $ ./gradlew jooq >>> >>> >>> There is more documentation about the configuration in the README for >>> the project. There are working examples in the example repo [2]. >>> >>> If you have problems or questions, open a pull request or file an issue. >>> >>> Thanks! >>> >>> [1] https://docs.gradle.org/current/userguide/kotlin_dsl.html >>> [2] https://github.com/bombinating/jooq-gradle-plugin-example >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "jOOQ User Group" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jooq-user/294e359d-f71d-4557-9f92-3387574cb175%40googlegroups.com >>> <https://groups.google.com/d/msgid/jooq-user/294e359d-f71d-4557-9f92-3387574cb175%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "jOOQ User Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jooq-user/CAB4ELO4v_wYo-%3D3m%3Dy-%3D7GzQUbpuMC53pdJmmx-5kFA5gPkdrg%40mail.gmail.com >> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO4v_wYo-%3D3m%3Dy-%3D7GzQUbpuMC53pdJmmx-5kFA5gPkdrg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/CAHpBFwKhdwAQYs7eXm5FkcFOz4ERm6kUyGjCvQhjcKv-K2cFQg%40mail.gmail.com > <https://groups.google.com/d/msgid/jooq-user/CAHpBFwKhdwAQYs7eXm5FkcFOz4ERm6kUyGjCvQhjcKv-K2cFQg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO5vN6d%2B%2BDSnTBjf2buq9hijqz-n40F6hzQTreVUAi475Q%40mail.gmail.com.
