This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
120 lines (102 loc) · 3.77 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val dusseldorfKtorVersion = "5.0.6"
val ktorVersion = "2.3.12"
val pdfBoxVersion = "3.0.3"
val imageIOVersion = "3.11.0"
val jsonassertVersion = "1.5.3"
val fuelVersion = "2.3.1"
val tokenSupportVersion = "5.0.3"
val mockOauth2ServerVersion = "2.1.9"
val junitVersion = "5.9.3"
val mainClass = "no.nav.helse.K9JoarkKt"
plugins {
kotlin("jvm") version "2.0.20"
id("org.sonarqube") version "5.1.0.4882"
jacoco
id("com.github.johnrengelman.shadow") version "8.1.1"
}
dependencies {
// Server
implementation("no.nav.helse:dusseldorf-ktor-core:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-jackson:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-metrics:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-health:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-ktor-auth:$dusseldorfKtorVersion")
// Client
implementation("no.nav.helse:dusseldorf-ktor-client:$dusseldorfKtorVersion")
implementation("no.nav.helse:dusseldorf-oauth2-client:$dusseldorfKtorVersion")
// Token validation
implementation("no.nav.security:token-validation-ktor-v2:$tokenSupportVersion")
// Bilde til PNG
implementation("org.apache.pdfbox:pdfbox:$pdfBoxVersion")
implementation("org.apache.pdfbox:pdfbox-io:$pdfBoxVersion")
implementation("com.twelvemonkeys.imageio:imageio-jpeg:$imageIOVersion")
// Test
testImplementation("no.nav.helse:dusseldorf-test-support:$dusseldorfKtorVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") {
exclude(group = "org.eclipse.jetty")
}
implementation("com.github.kittinunf.fuel:fuel:$fuelVersion")
implementation("com.github.kittinunf.fuel:fuel-coroutines:$fuelVersion") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
}
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation("org.skyscreamer:jsonassert:$jsonassertVersion")
testImplementation("no.nav.security:mock-oauth2-server:$mockOauth2ServerVersion")
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/navikt/dusseldorf-ktor")
credentials {
username = project.findProperty("gpr.user") as String? ?: "k9-joark"
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "21"
}
withType<ShadowJar> {
archiveBaseName.set("app")
archiveClassifier.set("")
manifest {
attributes(
mapOf(
"Main-Class" to mainClass
)
)
}
}
withType<Wrapper> {
gradleVersion = "8.5"
}
withType<Test> {
useJUnitPlatform()
finalizedBy(jacocoTestReport) // report is always generated after tests run
}
jacocoTestReport {
dependsOn(test) // tests are required to run before generating the report
reports {
xml.required.set(true)
csv.required.set(false)
}
}
}
sonarqube {
properties {
property("sonar.projectKey", "navikt_k9-joark")
property("sonar.organization", "navikt")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.token", System.getenv("SONAR_TOKEN"))
property("sonar.sourceEncoding", "UTF-8")
}
}