-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
121 lines (104 loc) · 3.79 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
val junitJupiterVersion = "5.12.1"
val k9rapidVersion = "1.20250225145424-cc27101"
val ktorVersion = "3.1.0"
val dusseldorfKtorVersion = "6.1.1"
val jsonassertVersion = "1.5.3"
// Database
val flywayVersion = "11.4.0"
val hikariVersion = "6.2.1"
val kotliqueryVersion = "1.9.1"
val postgresVersion = "42.7.5"
val embeddedPostgres = "2.1.0"
val embeddedPostgresBinaries = "12.9.0"
val mainClass = "no.nav.omsorgspenger.AppKt"
plugins {
kotlin("jvm") version "2.1.20"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.sonarqube") version "6.0.1.5171"
jacoco
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
dependencies {
implementation("no.nav.k9.rapid:river:$k9rapidVersion")
implementation("no.nav.helse:dusseldorf-ktor-core:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-health:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-jackson:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-auth:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-oauth2-client:$dusseldorfKtorVersion")
implementation("io.ktor:ktor-client-content-negotiation-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-cio-jvm:$ktorVersion")
// Database
implementation("com.zaxxer:HikariCP:$hikariVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("com.github.seratch:kotliquery:$kotliqueryVersion")
runtimeOnly("org.postgresql:postgresql:$postgresVersion")
// Test
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("io.zonky.test:embedded-postgres:$embeddedPostgres")
testImplementation(platform("io.zonky.test.postgres:embedded-postgres-binaries-bom:$embeddedPostgresBinaries"))
testImplementation("no.nav.helse:dusseldorf-test-support:$dusseldorfKtorVersion")
testImplementation("no.nav.k9.rapid:river-test:$k9rapidVersion")
testImplementation("org.skyscreamer:jsonassert:$jsonassertVersion")
testImplementation("io.ktor:ktor-server-test-host-jvm:$ktorVersion") {
exclude(group = "org.eclipse.jetty")
}
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
}
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/navikt/k9-rapid")
credentials {
username = project.findProperty("gpr.user") as String? ?: "x-access-token"
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
mavenCentral()
}
tasks {
withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
finalizedBy(jacocoTestReport)
}
withType<ShadowJar> {
archiveBaseName.set("app")
archiveClassifier.set("")
manifest {
attributes(
mapOf(
"Main-Class" to mainClass
)
)
}
// Fix for flyway bug https://github.com/flyway/flyway/issues/3482#issuecomment-1189357338
mergeServiceFiles()
}
withType<Wrapper> {
gradleVersion = "8.8"
}
withType<JacocoReport> {
dependsOn(test)
reports {
xml.required.set(true)
csv.required.set(false)
}
}
}
sonarqube {
properties {
property("sonar.projectKey", "navikt_omsorgspenger-sak")
property("sonar.organization", "navikt")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.login", System.getenv("SONAR_TOKEN"))
property("sonar.sourceEncoding", "UTF-8")
}
}