This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
123 lines (113 loc) · 4.62 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
val javaVersion = JavaVersion.VERSION_21
val ktorVersion = "2.3.12"
val kotlinxSerializationVersion = "1.7.1"
val kotlinxCoroutinesVersion = "1.8.1"
val prometheusVersion = "0.16.0"
val testContainersVersion = "1.17.3"
val jacksonVersion = "2.13.4"
val mockkVersion = "1.13.12"
plugins {
val kotlinVersion = "2.0.20"
application
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
// id("com.github.ben-manes.versions") version "0.47.0"
id("com.diffplug.spotless") version "6.25.0"
// id("ca.cutterslade.analyze") version "1.9.1"
}
repositories {
mavenCentral()
maven {
url = uri("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
maven("https://packages.confluent.io/maven/")
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$kotlinxCoroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:$kotlinxSerializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:$kotlinxSerializationVersion")
implementation("ch.qos.logback:logback-classic:1.5.7")
implementation("net.logstash.logback:logstash-logback-encoder:8.0")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("io.ktor:ktor-client-content-negotiation-jvm:$ktorVersion")
implementation("io.ktor:ktor-http-jvm:$ktorVersion")
implementation("io.ktor:ktor-serialization-jvm:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-host-common-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
implementation("io.ktor:ktor-utils-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-cio-jvm:$ktorVersion")
// implementation("io.micrometer:micrometer-registry-prometheus:1.8.1")
implementation("io.prometheus:simpleclient:$prometheusVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.apache.avro:avro:1.12.0")
implementation("io.confluent:kafka-avro-serializer:7.7.0") {
// we want to use the one provided by R&R, not the Confluent-specific one
exclude(group = "org.apache.kafka", module = "kafka-clients")
}
implementation("com.github.navikt:rapids-and-rivers:2024082313161724411773.1db923f4402d")
implementation("com.natpryce:konfig:1.6.10.0")
testImplementation(platform("org.junit:junit-bom:5.11.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("io.ktor:ktor-client-mock-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-server-test-host-jvm:$ktorVersion")
testImplementation("io.mockk:mockk-jvm:$mockkVersion")
testImplementation("io.mockk:mockk-dsl-jvm:$mockkVersion")
testImplementation("org.skyscreamer:jsonassert:1.5.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:$kotlinxCoroutinesVersion")
}
configurations.all {
// exclude JUnit 4
exclude(group = "junit", module = "junit")
}
application {
mainClass.set("no.nav.tiltakspenger.mottak.AppKt")
}
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
spotless {
kotlin {
ktlint("0.48.2")
}
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = javaVersion.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = javaVersion.toString()
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}
test {
// JUnit 5 support
useJUnitPlatform()
// https://phauer.com/2018/best-practices-unit-testing-kotlin/
systemProperty("junit.jupiter.testinstance.lifecycle.default", "per_class")
}
/*
analyzeClassesDependencies {
warnUsedUndeclared = true
warnUnusedDeclared = true
}
analyzeTestClassesDependencies {
warnUsedUndeclared = true
warnUnusedDeclared = true
}
*/
}
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.")
}