Note, there is also a user-contribution by Etienne Studer here:
https://github.com/etiennestuder/gradle-jooq-plugin

Am Mittwoch, 18. Juni 2014 13:12:09 UTC+2 schrieb Stéphane Cl:
>
> Hello,
>
> Almost exactly what I did...
>
> apply plugin: 'java'
>
> dependencies {
>     compile  group:'org.jooq', name:'jooq', version:'2.6.4'
>     compile  'postgresql:postgresql:9.1-901.jdbc4'
>     compile 'org.jooq:jooq-codegen:2.6.4'
>     compile 'org.jooq:jooq-meta:2.6.4'
> }
>
> task runCodeGen( dependsOn: 'jar', type: JavaExec)  {
>
>     main= 'org.jooq.util.GenerationTool'
>     classpath = files( sourceSets.main.runtimeClasspath , file('.'))
>
>     args '/gen.local.xml'
> }
>
> This project also contains a custom DefaultGeneratorStrategy which gets 
> passed to the classpath.
> ++
>
> Le mercredi 18 juin 2014 08:23:47 UTC+2, Lukas Eder a écrit :
>>
>> Hi Deven,
>>
>> Thank you very much for this contribution. Yes, we should be pushing that 
>> official plugin, but in the mean time, your post is very useful for many 
>> users.
>>
>> Cheers,
>> Lukas
>>
>>
>> 2014-06-17 20:38 GMT+02:00 Deven Phillips <[email protected]>:
>>
>>> 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.
>>>
>>
>>

-- 
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.

Reply via email to