-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.gradle
81 lines (69 loc) · 3.08 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
apply plugin: 'org.flywaydb.flyway'
apply plugin: 'nu.studer.jooq'
ext.moduleName = 'stroom.proxy.repo.db.jooq'
dependencies {
implementation libs.jakarta_annotation_api
implementation libs.jooq
runtimeOnly libs.sqlite
jooqGenerator libs.sqlite
}
def dbFile = File.createTempFile('stroom', '.db')
flyway {
println "Flyway using: " + dbFile.absolutePath
url = 'jdbc:sqlite:' + dbFile.absolutePath
// user = 'myUsr'
// password = 'mySecretPwd'
locations = ['filesystem:./src/main/resources/stroom/proxy/repo/db/sqlite']
table = 'proxy_repo_schema_history'
// placeholders = [
// 'keyABC': 'valueXYZ',
// 'otherplaceholder': 'value123'
// ]
}
// Configure jooq plugin to generate code
jooq {
println "JOOQ using: " + dbFile.absolutePath
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)
configurations {
main { // name of the jOOQ configuration
// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'org.sqlite.JDBC'
url = 'jdbc:sqlite:' + dbFile.absolutePath
// user = 'sa'
// password = 'sa'
}
generator {
name = 'org.jooq.codegen.JavaGenerator'
database {
name = 'org.jooq.meta.sqlite.SQLiteDatabase'
// inputSchema = 'PUBLIC'
// Add anything you want included in generation below, whitespace ignored
// and comments allowed. Each one is a java regex
includes = '.*'//'zip_source|zip_data|zip_entry|zip_dest|zip_dest_data'
// We don't want to include flyway versioning
excludes = 'proxy_repo_schema_history'
// // Specify 'version' for use in optimistic concurrency control
// recordVersionFields = 'version'
// // Treat tinyint(1) columns as booleans
// forcedTypes {
// forcedType {
// name = 'BOOLEAN'
// types = '(?i:TINYINT\\(1\\))'
// }
// }
}
target {
packageName = 'stroom.proxy.repo.db.jooq'
directory = 'src/main/java'
}
}
}
}
}
}
tasks.generateJooq.dependsOn flywayMigrate