-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
126 lines (102 loc) · 4.12 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
application
alias(libs.plugins.kotlin)
alias(libs.plugins.spotless)
alias(libs.plugins.shadow.jar)
}
repositories {
mavenCentral()
maven("https://packages.confluent.io/maven/")
maven("https://jitpack.io")
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
application {
applicationName = "dp-regel-api"
mainClass.set("no.nav.dagpenger.regel.api.RegelApiKt")
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.github.navikt:dagpenger-streams:2023081812031692353030.ca95330b1ba8")
implementation("com.github.navikt:dp-inntekt-kontrakter:1_20231220.55a8a9")
implementation("com.github.navikt:dagpenger-events:20231220.3050bf")
implementation(libs.bundles.jackson)
val kafkaVersion = "7.7.1-ce"
implementation("org.apache.kafka:kafka-clients:$kafkaVersion")
implementation("org.apache.kafka:kafka-streams:$kafkaVersion")
val ktorServerVersion = libs.versions.ktor.get()
implementation(libs.bundles.ktor.server)
implementation(libs.ktor.server.metrics.micrometer)
implementation("io.ktor:ktor-server-netty:$ktorServerVersion")
implementation("io.ktor:ktor-server-default-headers:$ktorServerVersion")
implementation("io.ktor:ktor-server-locations:$ktorServerVersion")
implementation(libs.bundles.ktor.client)
implementation("io.micrometer:micrometer-registry-prometheus:1.10.1")
val log4j2Version = "2.24.1"
implementation("org.apache.logging.log4j:log4j-api:$log4j2Version")
implementation("org.apache.logging.log4j:log4j-core:$log4j2Version")
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:$log4j2Version")
implementation("org.apache.logging.log4j:log4j-layout-template-json:$log4j2Version")
implementation("org.slf4j:slf4j-api:1.7.25")
implementation(libs.kotlin.logging)
implementation("de.huxhorn.sulky:de.huxhorn.sulky.ulid:8.3.0")
implementation(libs.bundles.postgres)
implementation(libs.konfig)
val prometheusVersion = "0.16.0"
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("io.prometheus:simpleclient_log4j2:$prometheusVersion")
testImplementation(kotlin("test"))
testImplementation(libs.ktor.server.test.host)
testImplementation(libs.kotest.assertions.core)
testImplementation("io.kotest:kotest-property-jvm:${libs.versions.kotest.get()}")
testImplementation("io.kotest:kotest-runner-junit5-jvm:${libs.versions.kotest.get()}")
testImplementation(libs.testcontainer.postgresql)
testImplementation("org.testcontainers:kafka:1.20.3")
testImplementation("org.apache.kafka:kafka-streams-test-utils:7.7.1-ce")
testImplementation("no.nav.security:mock-oauth2-server:2.1.10")
testImplementation(libs.mockk)
val junitVersion = libs.versions.junit.get()
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
configurations {
this.all {
exclude(group = "ch.qos.logback")
}
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
ktlint()
}
kotlinGradle {
ktlint()
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
showExceptions = true
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
tasks.withType<Wrapper> {
gradleVersion = "7.3.3"
}
tasks.named("compileKotlin") {
dependsOn("spotlessCheck")
}
tasks.withType<ShadowJar> {
transform(Log4j2PluginsCacheFileTransformer::class.java)
mergeServiceFiles()
}