forked from Nikkirche/balloons-reborn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
107 lines (92 loc) · 2.77 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
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
import nu.studer.gradle.jooq.JooqGenerate
import org.jooq.meta.jaxb.Logging
plugins {
application
java
alias(libs.plugins.jooq)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.shadow)
}
group = "org.icpclive.balloons"
version = "0.0.1"
kotlin {
jvmToolchain(17)
}
application {
mainClass.set("org.icpclive.balloons.ApplicationKt")
}
repositories {
mavenCentral()
maven("https://jitpack.io") {
group = "com.github.icpc.live-v3"
}
}
dependencies {
jooqGenerator(libs.h2)
implementation(libs.bundles.ktor)
implementation(libs.logback)
implementation(libs.live.cds)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.json)
implementation(libs.h2)
implementation(libs.bundles.jooq)
implementation(libs.bcrypt)
testImplementation(libs.ktor.server.test.host)
testImplementation(libs.kotlin.test.junit5)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.launcher)
}
jooq {
version = libs.versions.jooq
configurations {
create("main") {
generateSchemaSourceOnCompilation = true
jooqConfiguration.apply {
logging = Logging.WARN
jdbc.apply {
driver = "org.h2.Driver"
url = "jdbc:h2:mem:;INIT=RUNSCRIPT FROM './src/main/resources/schema.sql'"
}
generator.apply {
name = "org.jooq.codegen.KotlinGenerator"
database.apply {
inputSchema = "PUBLIC"
includes = ".*"
}
target.apply {
packageName = "org.icpclive.balloons.db"
directory = "./build/jooq"
}
generate.apply {
isKotlinNotNullPojoAttributes = true
isKotlinNotNullRecordAttributes = true
isKotlinNotNullInterfaceAttributes = true
isKotlinDefaultedNullablePojoAttributes = false
isKotlinDefaultedNullableRecordAttributes = false
}
}
}
}
}
}
tasks {
named<JooqGenerate>("generateJooq") {
inputs.file("src/main/resources/schema.sql")
allInputsDeclared = true
}
named<Test>("test") {
useJUnitPlatform()
}
shadowJar {
mergeServiceFiles()
archiveClassifier = null
}
processResources {
if (project.properties["balloons.embedFrontend"] == "true") {
from(project(":frontend").tasks.named("pnpm_run_build")) {
into("frontend")
}
}
}
}