javagradlegroovyjooq

JOOQ + Gradle: How to define multiple schemas for JOOQ generator?


I want to setup JOOQ generator. The problem is to set multiple schemas in build.gradle. I know how to do it with maven:

<schemata>
  <schema>
    <inputSchema>schema1</inputSchema>
  </schema>
  <schema>
    <inputSchema>schema2</inputSchema>
  </schema>
</schemata>

I know how to do it with build.gradle.kts:

schemata.addAll(
    arrayOf(
        SchemaMappingType()
            .withInputSchema("data"),
         SchemaMappingType()
            .withInputSchema("dictionaries")
    )
)

But I don't know syntax how to do it in gradle.build on Groovy.

Please, help.


Solution

  • I'm assuming you're using the gradle-jooq-plugin, so

    Just write:

    schemata {
      schema {
        inputSchema = 'data'
      }
      schema {
        inputSchema = 'dictionaries'
      }
    }