For those of you, like me, who are too impatient to wait for the official
gradle plugin, here's a working methodology for codegen with gradle:
In your build.gradle add:
dependencies {
<.... existing dependencies ....>
compile 'org.jooq:jooq:3.2.2'
compile 'org.jooq:jooq-meta:3.2.2'
compile 'org.jooq:jooq-codegen:3.2.2'
}
ext.jooqConfigFileName = '<XML configuration file name>'
ext.jooqConfig = file jooqConfigFileName
ext.jooqGeneratedCode = file "${buildDir}/generated-sources/jooq"
task jooqCodegen (type: JavaExec) {
inputs.files jooqConfig
outputs.dir jooqGeneratedCode
main = 'org.jooq.util.GenerationTool'
classpath = sourceSets.main.compileClasspath +
files('src/main/resources')
args = ['/'+jooqConfigFileName]
doFirst {
jooqGeneratedCode.mkdirs()
}
}
sourceSets {
main {
java {
srcDir "${buildDir}/generated-sources/jooq"
}
}
}
compileJava.dependsOn(jooqCodegen)
Place your XML configuration file in src/main/resources and configure it as
you would when using the CLI command.
--
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].
For more options, visit https://groups.google.com/d/optout.