Hi Kevin, jOOQ's code generator doesn't really know *how* you run it. I'm not a Gradle guru myself, but build tools often set base directories in one way or another (e.g. where you run the gradle process isn't the same as where the project resides, or the parent project in case you have modules, etc.) Personally, I never trust my judgement in understanding this behaviour, and instead, always use explicit environment variables, system properties or other well known variables. So, telling jOOQ explicitly what $projectDir means to you, which is a well known, documented variable, does seem quite alright, no? Why wouldn't it be?
See: https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#N14F19 Cheers, Lukas On Sat, Jul 8, 2023 at 7:00 PM Kevin Jones <[email protected]> wrote: > I've setup JOOQ code generation in Gradle using the Kotlin DSL. > > > The generator works except that I have to use the fully qualified name for > the output directory, so > > > .withTarget( > Target() > .withPackageName("com.knowledgespike.db") > > .withDirectory("/users/kevinj/projects/thisproject/src/main/generated/kotlin") > > ) > > > works, but > > > .withTarget( > Target() > .withPackageName("com.knowledgespike.db") > .withDirectory("src/main/generated/kotlin") > ) > > > doesn't > > > If I set the baseDirectory on the configuration object that also works > (i.e. I get the code generated relative to the base directory). > > > What I'd like is to get the code generated in my current project directory. > > > I can call .withBasedir("$projectDir") but that doesn't feel right to me. > Should this "just work"? > > > Thanks, > > > Kevin Jones > > -- > 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/84785ad5-285c-4ac8-90c9-80658024b233n%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/84785ad5-285c-4ac8-90c9-80658024b233n%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/CAB4ELO58R1_1Oe%2BxkVAgmtMFrjygwUn_KR8fHWr5d%2BaQhp7yOA%40mail.gmail.com.
