-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
182 lines (154 loc) · 6.37 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
group = "no.nav.syfo"
version = "1.0.0"
val ktorVersion="3.0.2"
val coroutinesVersion="1.9.0"
val prometheusVersion="0.16.0"
val junitJupiterVersion="5.11.3"
val logbackVersion="1.5.12"
val logstashEncoderVersion="8.0"
val jacksonVersion="2.18.2"
val jaxwsApiVersion="2.3.1"
val javaxAnnotationApiVersion="1.3.2"
val jaxbRuntimeVersion="2.4.0-b180830.0438"
val jaxbApiVersion="2.4.0-b180830.0359"
val javaxActivationVersion="1.1.1"
val commonsTextVersion="1.12.0"
val javaTimeAdapterVersion="1.1.3"
val syfoxmlcodegen="2.0.1"
val jfairyVersion="0.6.5"
val kafkaVersion="3.9.0"
val mockkVersion="1.13.13"
val kotlinVersion="2.1.0"
val googleCloudStorageVersion="2.45.0"
val flywayVersion="11.1.0"
val hikariVersion="6.2.1"
val postgresVersion="42.7.4"
val testcontainersPostgresVersion="1.20.4"
val ktfmtVersion="0.44"
val commonsCodecVersion = "1.17.1"
val snappyJavaVersion = "1.1.10.7"
val commonsCompressVersion = "1.27.1"
val nettyCodecHttp2Version = "4.1.115.Final"
val ibmMqVersion = "9.4.1.0"
plugins {
id("application")
kotlin("jvm") version "2.1.0"
id("com.gradleup.shadow") version "8.3.5"
id("com.diffplug.spotless") version "6.25.0"
}
application {
mainClass.set("no.nav.syfo.ApplicationKt")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
maven(url= "https://packages.confluent.io/maven/")
maven {
url = uri("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutinesVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
constraints {
implementation("io.netty:netty-codec-http2:$nettyCodecHttp2Version") {
because("override transient from io.ktor:ktor-server-netty, see CVE-2024-29025")
}
}
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
constraints {
implementation("commons-codec:commons-codec:$commonsCodecVersion") {
because("override transient from io.ktor:ktor-client-apache")
}
}
implementation("org.apache.kafka:kafka_2.12:$kafkaVersion")
constraints {
implementation("org.xerial.snappy:snappy-java:$snappyJavaVersion") {
because("override transient from org.apache.kafka:kafka_2.12")
}
}
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("javax.xml.ws:jaxws-api:$jaxwsApiVersion")
implementation("javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion")
implementation("javax.xml.bind:jaxb-api:$jaxbApiVersion")
implementation("org.glassfish.jaxb:jaxb-runtime:$jaxbRuntimeVersion")
implementation("javax.activation:activation:$javaxActivationVersion")
implementation("com.ibm.mq:com.ibm.mq.jakarta.client:$ibmMqVersion")
implementation("no.nav.helse.xml:xmlfellesformat:$syfoxmlcodegen")
implementation("no.nav.helse.xml:kith-hodemelding:$syfoxmlcodegen")
implementation("no.nav.helse.xml:kith-apprec:$syfoxmlcodegen")
implementation("no.nav.helse.xml:legeerklaering:$syfoxmlcodegen")
implementation("no.nav.helse.xml:arenainfo-2:$syfoxmlcodegen")
implementation("com.google.cloud:google-cloud-storage:$googleCloudStorageVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
compileOnly("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("org.apache.commons:commons-text:$commonsTextVersion")
implementation("com.migesok", "jaxb-java-time-adapters", javaTimeAdapterVersion)
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") {
exclude(group = "org.eclipse.jetty")
}
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("com.devskiller:jfairy:$jfairyVersion") {
exclude(group = "org.apache.commons", module = "commons-text")
}
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.testcontainers:postgresql:$testcontainersPostgresVersion")
constraints {
testImplementation("org.apache.commons:commons-compress:$commonsCompressVersion") {
because("overrides vulnerable dependency from org.testcontainers:postgresql")
}
}
}
tasks {
shadowJar {
mergeServiceFiles {
setPath("META-INF/services/org.flywaydb.core.extensibility.Plugin")
}
archiveBaseName.set("app")
archiveClassifier.set("")
isZip64 = true
manifest {
attributes(
mapOf(
"Main-Class" to "no.nav.syfo.ApplicationKt",
),
)
}
}
test {
useJUnitPlatform {}
testLogging {
events("skipped", "failed")
showStackTraces = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
task("addPreCommitGitHookOnBuild") {
println("⚈ ⚈ ⚈ Running Add Pre Commit Git Hook Script on Build ⚈ ⚈ ⚈")
exec {
commandLine("cp", "./.scripts/pre-commit", "./.git/hooks")
}
println("✅ Added Pre Commit Git Hook Script.")
}
spotless {
kotlin { ktfmt(ktfmtVersion).kotlinlangStyle() }
check {
dependsOn("spotlessApply")
}
}
}