Hey Lukas,
thanks for the fixes in JOOQ 3.19.2 for Kotlin, that is all working now.
One issue I'm having though is with the JOOQ plugin. I've just switched to
this after previously manually creating a generator task in my Gradle file,
and I have a couple of issues (both of which maybe my mistakes)
The first issue (and the biggest) is that the generator task is not
"depended upon" by the Kotlin compile task. So when I created my own
generator task (called "generateJOOQ") that task was run as part of the
Kotlin compilation.
However, when I use the plugin I have to manually a dependency on the
"jooqCodegen" from the Kotlin compile task, so I need to add this to my
buildfile:
tasks.compileKotlin {
dependsOn(tasks["jooqCodegen"])
}
The other issue is around sourceSets. I'm configuring the generator to
create its sources in a directory called build/generated, I do this by
setting the 'basedir' property of the task to the Gradle build directory
and then the 'target' directory of the generator to 'generated/java. I then
have a sourceSet declaration in the Gradle file that points at that
directory.
So something like this:
jooq {
val output: Provider<Directory> = layout.buildDirectory.dir(".")
configuration {
basedir = "${output.get()}"
jdbc {
...
}
generator {
name = "org.jooq.codegen.KotlinGenerator"
database {
...
}
target {
packageName = "com.knowledgespike.db"
directory = "generated/java"
isClean = true
}
}
}
}
This works, the code is generated into the correct directory and everything
complies but the plugin also creates it's own sourceSet at
"./generated/java" is there anyway to prevent that?
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/d7a0e3be-1c50-4ae4-a372-a12537cdf8c4n%40googlegroups.com.