-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
52 lines (46 loc) · 1.85 KB
/
build.gradle.kts
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
import nu.studer.gradle.jooq.JooqGenerate
import org.jooq.meta.jaxb.Property
plugins {
id("java-library")
id("nu.studer.jooq").version("8.0")
}
repositories{
mavenCentral()
}
dependencies {
jooqGenerator(project(":jooq-liquibase"))//this repository
jooqGenerator("org.liquibase:liquibase-core:4.23.0")//(optional!) only needed when pinning a version
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
jooq {
version = "3.16.3"
configurations {
//this is kotlin gradle syntax. When using groovy (.gradle instead of .gradle.kts) see here https://github.com/etiennestuder/gradle-jooq-plugin/blob/main/example/configure_toolchain_gradle_dsl/build.gradle
create("main") {
jooqConfiguration.apply {
jdbc.apply {
driver = "org.testcontainers.jdbc.ContainerDatabaseDriver"
url = "jdbc:tc:mysql:8.0.33:///;databaseName=YOUR_SCHEMA_NAME?TC_TMPFS=/testtmpfs:rw&user=root"
}
generator.apply {
database.apply {
name = "eu.nitok.jooq.extension.MySqlLiquibaseDatabase"
properties.apply {
add(Property().withKey("scripts").withValue("changelog.xml"))
add(Property().withKey("database.defaultSchemaName").withValue("YOUR_SCHEMA_NAME"))
add(Property().withKey("database.liquibaseSchemaName").withValue("PUBLIC"))
}
}
}
}
}
}
}
tasks.named<JooqGenerate>("generateJooq").configure {
(runtimeClasspath as? ConfigurableFileCollection)?.from(tasks.processResources.get().outputs.files)
allInputsDeclared = true
}
tasks.test {
useJUnitPlatform()
}