-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
141 lines (129 loc) · 5.39 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
val junitJupiterVersion = "5.10.2"
val ktorVersion = "2.3.12"
val jvmTargetVersion = "21"
val graphqlKotlinVersion = "7.1.4"
val rapidsAndRiversVersion = "2024022311041708682651.01821651ed22"
val logbackSyslog4jVersion = "1.0.0"
val hikariCPVersion = "5.1.0"
val flywayCoreVersion = "10.9.0"
val kotliqueryVersion = "1.9.0"
val mockkVersion = "1.13.10"
val postgresqlVersion = "42.7.3"
plugins {
kotlin("jvm") version "1.9.23"
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
}
val githubUser: String by project
val githubPassword: String by project
allprojects {
group = "no.nav.helse"
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/navikt/*")
credentials {
username = githubUser
password = githubPassword
}
}
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
ignoreFailures = true
// Hvis du gjør endringer i disse filterne må du slette alle "build"/"out"-mappene og deretter
// kjøre ./gradlew --no-build-cache ktlintCheck minst én gang for at endringene skal ta effekt
filter {
exclude { it.file.path.contains("generated") }
exclude { it.file.path.contains("test") }
}
}
dependencies {
implementation("com.github.navikt:rapids-and-rivers:$rapidsAndRiversVersion")
implementation("io.ktor:ktor-server-cio:$ktorVersion")
implementation("io.ktor:ktor-server-websockets:$ktorVersion")
implementation("org.postgresql:postgresql:$postgresqlVersion")
implementation("com.papertrailapp:logback-syslog4j:$logbackSyslog4jVersion") // August, 2014
{
exclude(group = "ch.qos.logback")
}
implementation("com.zaxxer:HikariCP:$hikariCPVersion")
implementation("org.flywaydb:flyway-core:$flywayCoreVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayCoreVersion")
implementation("com.github.seratch:kotliquery:$kotliqueryVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
constraints {
implementation("commons-codec:commons-codec") {
version { require("1.13") }
because("ktor-client-apache v2.3.7 -> httpclient -> commons-codec v1.11 har en sårbarhet")
}
}
implementation("io.ktor:ktor-client-jackson:$ktorVersion") {
exclude(group = "com.fasterxml.jackson.core")
exclude(group = "com.fasterxml.jackson.module")
}
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion") {
exclude(group = "junit")
}
implementation("com.expediagroup:graphql-kotlin-client:$graphqlKotlinVersion")
implementation("com.expediagroup:graphql-kotlin-client-jackson:$graphqlKotlinVersion") {
exclude(group = "com.fasterxml.jackson.core")
exclude(group = "com.fasterxml.jackson.module")
}
implementation("com.expediagroup:graphql-kotlin-ktor-client:$graphqlKotlinVersion") {
exclude("com.expediagroup:graphql-kotlin-client-serialization")
}
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("io.ktor:ktor-server-call-id:$ktorVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
testImplementation("io.ktor:ktor-client-mock-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") {
exclude(group = "junit")
}
testImplementation("io.mockk:mockk:$mockkVersion")
}
}
subprojects {
kotlin {
jvmToolchain(21)
}
tasks {
named<Test>("test") {
useJUnitPlatform()
testLogging {
events("skipped", "failed")
showStackTraces = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
register<Wrapper>("wrapper") {
gradleVersion = "8.5"
}
}
}
tasks {
jar {
enabled = false
}
build {
doLast {
val erLokaltBygg = !System.getenv().containsKey("GITHUB_ACTION")
val manglerPreCommitHook = !File(".git/hooks/pre-commit").isFile
if (erLokaltBygg && manglerPreCommitHook) {
println("""
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ¯\_(⊙︿⊙)_/¯ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Hei du! Det ser ut til at du mangler en pre-commit-hook :/ !
! Du kan installere den ved å kjøre './gradlew addKtlintFormatGitPreCommitHook' !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
""".trimIndent())
}
}
}
}