java - JOOQ class generation and gradle -


my question best way set build using gradle , jooq following constraints:

i have:

  • a basic gradle build file, 1 can use eclipse, jooq, postgres , hsql
  • some 'core' java classes, including couple of enums, in eclipse project managed gradle
  • several database schemata, each in own file (schema1.sql, schema2.sql, etc), in same project
  • the excellent jooq library, , quite cool sqlfile utility hsqldb
  • a combination of ant scripts , java programs following steps, in pretty handraulic fashion, , i'd automate.

i want following functionality managed gradle:

  • the core classes compiled
  • each of database schema loaded postgres database (i know how in gradle)
  • the jooq library generate classes each schema (i know how in gradle) using type mapping map database columns appropriate core class enums (i don't yet know how in gradle, because don't know how give jooq task access core classes)

there appear several options in front of me, i'm not sure 1 best:

  • option one: split project 2 projects, "core" , "db", former being used latter column-to-enum mappings, , downstream projects depending on both
  • option two: keep 1 project, split generation 3 steps "compile core", "generate classes", "compile generated classes", each step has access generated artefacts of previous. don't know how this.

i think can work out how either, given enough time, i'm wondering if solved problem, , there's obvious or canonical way it. record, preference option two, because pattern recurs other projects, , option 1 double number of projects have deal with. (maybe isn't bad...)

sorry if vague question - documentation of gradle pretty "this how x" point of view, don't feel i'm getting overview of how bits hang together.

i appreciate help.

edit

i have related question specifics of how option 2. question , answer here gradle: assembling multiple source-sets 1 jar

while question , answer describe how option two, don't answer broader question of "is best way go it", i'm leaving question open.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -