-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (110 loc) · 3.41 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
buildscript {
ext {
springBootVersion = '2.4.1'
jooqVersion = '3.14.4'
postgresVersion = '42.2.14'
flywayVersion = '7.4.0'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "io.spring.gradle:dependency-management-plugin:1.0.10.RELEASE"
classpath 'nu.studer:gradle-jooq-plugin:4.1'
}
}
plugins {
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'nu.studer.jooq' version '4.1'
}
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "java"
apply plugin: "nu.studer.jooq"
group = 'johnc'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jooq'
implementation 'org.postgresql:postgresql:42.2.18'
implementation 'org.flywaydb:flyway-core'
implementation 'joda-time:joda-time:2.10.3'
implementation "org.jooq:jooq-codegen:$jooqVersion"
implementation 'cz.jirutka.rsql:rsql-parser:2.1.0'
jooqRuntime "org.postgresql:postgresql:$postgresVersion"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
sourceSets {
main {
java {
srcDirs = ['src/main/java', 'src/generated/java']
}
}
}
// Jooq Code Gen
jooq {
sample(sourceSets.main) {
jdbc {
driver = 'org.postgresql.Driver'
url = 'jdbc:postgresql://localhost:5432/postgres'
user = 'postgres'
password = 'postgres'
}
generator {
generate {
javaTimeTypes = true
springAnnotations = true
}
strategy {
name = 'org.jooq.codegen.DefaultGeneratorStrategy'
}
database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'public'
excludes = '.*flyway_schema_history'
includeTables = true
includeRoutines = false
includePackages = true
includePackageRoutines = true
includePackageUDTs = true
includePackageConstants = false
includeUDTs = true
includeSequences = false
includePrimaryKeys = false
includeUniqueKeys = false
includeForeignKeys = false
includeIndexes = false
}
target {
packageName = 'johnc.rsqljooq.jooq'
directory = 'src/generated/java'
}
}
}
}
tasks.generateSampleJooqSchemaSource.with {
def out = new ByteArrayOutputStream()
javaExecSpec = { JavaExecSpec s ->
s.standardOutput = out
s.errorOutput = out
s.ignoreExitValue = true
}
execResultHandler = { ExecResult r ->
if (r.exitValue != 0) {
throw RuntimeException('jOOQ codegen failed:\n\n' + out.toString())
}
}
}
test {
useJUnitPlatform()
}
generateSampleJooqSchemaSource.enabled = true