-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample-07-evolution.gradle
48 lines (43 loc) · 1.1 KB
/
example-07-evolution.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.h2database:h2:1.4.186'
classpath 'org.jooq:jooq-codegen:3.8.1'
}
}
plugins {
id 'io.ratpack.ratpack-groovy' version '1.3.3'
}
repositories {
jcenter()
}
dependencies {
compile ratpack.dependency('hikari')
compile 'com.h2database:h2:1.4.186'
compile 'org.jooq:jooq:3.8.1'
}
import org.jooq.util.jaxb.*
import org.jooq.util.*
task jooqCodegen {
doLast {
String init = "$projectDir/src/main/resources/init.sql".replaceAll('\\\\', '/')
Configuration configuration = new Configuration()
.withJdbc(new Jdbc()
.withDriver("org.h2.Driver")
.withUrl("jdbc:h2:mem:todo;INIT=RUNSCRIPT FROM '$init'")
)
.withGenerator(new Generator()
.withDatabase(new Database()
.withName("org.jooq.util.h2.H2Database")
.withIncludes(".*")
.withExcludes("")
.withInputSchema("PUBLIC")
)
.withTarget(new Target()
.withDirectory("$projectDir/src/main/groovy")
.withPackageName("jooq")))
GenerationTool.generate(configuration)
}
}