-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
196 lines (163 loc) · 6.45 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import org.jooq.meta.jaxb.Logging
import org.jooq.meta.jaxb.Property
plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.21"
id("org.jetbrains.kotlin.plugin.allopen") version "1.9.21"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.micronaut.application") version "4.2.0"
id("io.micronaut.test-resources") version "4.2.0"
id("io.micronaut.aot") version "4.2.0"
id("nu.studer.jooq") version "8.2"
id("com.google.devtools.ksp") version "1.9.21-1.0.16"
id("org.graalvm.buildtools.native") version "0.10.0"
kotlin("plugin.serialization") version "1.9.21"
}
version = "0.0.1"
group = "win.rushmi0.jungmha"
val kotlinVersion = project.properties["kotlinVersion"]
repositories {
mavenCentral()
}
dependencies {
compileOnly("io.micronaut:micronaut-http-client")
compileOnly("io.micronaut.openapi:micronaut-openapi-annotations")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.postgresql:postgresql")
jooqGenerator("org.postgresql:postgresql:42.3.9")
ksp("io.micronaut:micronaut-http-validation")
ksp("io.micronaut.openapi:micronaut-openapi:6.4.0")
ksp("io.micronaut.serde:micronaut-serde-processor")
annotationProcessor("io.micronaut.openapi:micronaut-openapi:2.1.1")
testImplementation("io.micronaut:micronaut-http-client")
implementation("io.swagger.core.v3:swagger-annotations")
implementation("io.micronaut:micronaut-websocket")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut.serde:micronaut-serde-jackson")
implementation("io.micronaut.sql:micronaut-jdbc-hikari")
implementation("io.micronaut.sql:micronaut-jooq")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
// https://github.com/Kotlin/kotlinx.serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
implementation("org.bouncycastle:bcprov-jdk18on:1.77")
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
// https://mvnrepository.com/artifact/io.micronaut.rxjava2/micronaut-rxjava2
implementation("io.micronaut.rxjava2:micronaut-rxjava2:2.2.1")
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation("com.google.guava:guava:32.1.2-jre")
}
tasks
.withType<KotlinJvmCompile>()
.configureEach {
compilerOptions
.languageVersion
.set(
KotlinVersion.KOTLIN_2_0
)
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}
tasks {
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
}
application {
mainClass.set("win.rushmi0.jungmha.ApplicationKt")
}
graalvmNative {
binaries {
all {
// * https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildOutput/?fbclid=IwAR007Rh7fYg-CJZywqhFM8PF5XDWPvgOfaV9txFDqpy6PWjtZp2bXpgncL0_aem_Af0UTqW_wKY5RFkebOwqrANSJn-d6fpSoJLMyra23KLgMNQuur3l75gjN29_Ymw1JYkeX7upxGBzGPFkJ4iRuojh
buildArgs.add("-H:+AddAllCharsets")
buildArgs.add("-R:MaxHeapSize=4G")
//buildArgs.add("-J-XX:MaxRAMPercentage=60.0")
//buildArgs.add("--target=linux-x86-64-v3")
imageName.set("${project.name}-0.0.1-alpha")
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.GRAAL_VM)
})
verbose.set(true)
}
}
}
//graalvmNative.toolchainDetection.set(true)
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("org.jungmha.*")
}
testResources {
additionalModules.add("jdbc-postgresql")
}
aot {
// Please review carefully the optimizations enabled below
// Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
optimizeServiceLoading.set(false)
convertYamlToJava.set(false)
precomputeOperations.set(true)
cacheEnvironment.set(true)
optimizeClassLoading.set(true)
deduceEnvironment.set(true)
optimizeNetty.set(true)
}
}
jooq {
version.set("3.18.7") // default (can be omitted)
edition.set(nu.studer.gradle.jooq.JooqEdition.OSS) // default (can be omitted)
configurations {
create("main") { // name of the jOOQ configuration
generateSchemaSourceOnCompilation.set(true) // default (can be omitted)
jooqConfiguration.apply {
logging = Logging.WARN
//logging = Logging.DEBUG
jdbc.apply {
driver = "org.postgresql.Driver"
//url = "jdbc:postgresql://localhost:5432/postgres"
url = "jdbc:postgresql://jungmha-postgres:5432/postgres"
user = "postgres"
password = "sql@min"
properties.add(Property().apply {
key = "ssl"
value = "false"
})
}
generator.apply {
name = "org.jooq.codegen.DefaultGenerator"
database.apply {
name = "org.jooq.meta.postgres.PostgresDatabase"
inputSchema = "public"
}
generate.apply {
isDeprecated = false
isRecords = true
isImmutablePojos = true
isFluentSetters = true
}
target.apply {
packageName = "win.rushmi0.jungmha.infra.database"
directory = "target/infra/jooq/main"
}
strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy"
}
}
}
}
}