-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
77 lines (63 loc) · 1.76 KB
/
build.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.postgresql:postgresql:9.4-1206-jdbc42'
classpath 'org.jooq:jooq-codegen:3.7.1'
classpath 'org.jyaml:jyaml:1.3'
}
}
plugins {
id 'io.ratpack.ratpack-java' version '1.1.1'
id 'com.github.johnrengelman.shadow' version '1.2.2'
id 'idea'
}
repositories {
jcenter()
}
mainClassName = 'App'
task stage(dependsOn: installShadowApp)
dependencies {
compile 'org.slf4j:slf4j-api:1.7.13'
runtime 'org.postgresql:postgresql:9.4-1206-jdbc42'
compile 'org.jooq:jooq:3.7.1'
compile 'biz.paluch.redis:lettuce:4.0.1.Final'
compile ratpack.dependency('hikari')
}
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
vcs = 'Git'
}
}
import org.jooq.util.jaxb.*
import org.jooq.util.*
import org.ho.yaml.Yaml
task jooqCodegen {
doLast {
def config = Yaml.load(file('src/ratpack/postgres.yaml')).db
def dsProps = config.dataSourceProperties
Configuration configuration = new Configuration()
.withJdbc(new Jdbc()
.withDriver("org.postgresql.Driver")
.withUrl("jdbc:postgresql://$dsProps.serverName:$dsProps.portNumber/$dsProps.databaseName")
.withUser(config.username)
.withPassword(config.password))
.withGenerator(new Generator()
// .withGenerate(new Generate()
// .withImmutablePojos(true)
// .withDaos(true)
// .withFluentSetters(true))
.withDatabase(new Database()
.withName("org.jooq.util.postgres.PostgresDatabase")
.withIncludes(".*")
.withExcludes("")
.withInputSchema("public"))
.withTarget(new Target()
.withPackageName("jooq")
.withDirectory("src/main/java")))
GenerationTool.generate(configuration)
}
}