-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
163 lines (132 loc) · 4.22 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "no.nav.sosialhjelp"
plugins {
`jvm-test-suite`
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.plugin.spring)
alias(libs.plugins.spring.boot)
alias(libs.plugins.versions)
alias(libs.plugins.ktlint)
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
ktlint {
this.version.set(libs.versions.ktlint)
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation(libs.bundles.coroutines)
implementation(libs.bundles.spring.boot)
// Sosialhjelp-common
implementation(libs.bundles.sosialhjelp.common)
// tokendings
implementation(libs.auth0.java.jwt)
implementation(libs.auth0.jwks.rsa)
implementation(libs.nimbus.jose.jwt)
// Micrometer/Prometheus
implementation(libs.bundles.prometheus)
// Logging
implementation(libs.bundles.logging)
// Tracing
implementation(platform(libs.opentelemetry.bom))
implementation(libs.opentelemetry.api)
// Filformat
implementation(libs.sosialhjelp.filformat)
// Fiks IO
implementation(libs.fiks.io)
// Jackson
implementation(libs.jackson.module.kotlin)
// Token-validering
implementation(libs.token.validation.spring)
// Springdoc
implementation(libs.springdoc.openapi.starter.common)
implementation(libs.springdoc.openapi.starter.webmvc.ui)
// Fiks-kryptering
implementation(libs.fiks.kryptering)
// Unleash
implementation(libs.unleash)
// Redis
implementation(libs.lettuce.core)
// Div
implementation(libs.bundles.commons)
implementation(libs.apache.tika)
implementation(libs.apache.pdfbox.preflight)
implementation(libs.apache.pdfbox.jempbox)
// Test
testImplementation(libs.spring.boot.starter.test)
testImplementation(libs.springmockk)
testImplementation(libs.mockk)
testImplementation(libs.token.validation.spring.test)
}
// override spring managed dependencies
extra["json-smart.version"] = libs.versions.json.smart
val githubUser: String by project
val githubPassword: String by project
repositories {
mavenCentral()
maven("https://plugins.gradle.org/m2/")
maven("https://repo.spring.io/plugins-release/")
maven {
url = uri("https://maven.pkg.github.com/navikt/sosialhjelp-common")
credentials {
username = githubUser
password = githubPassword
}
}
}
fun String.isNonStable(): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(this)
return isStable.not()
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
candidate.version.isNonStable() && !currentVersion.isNonStable()
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "21"
}
}
testing {
suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter()
targets {
all {
testTask.configure {
testLogging {
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
}
}
}
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
}
}
tasks.getByName<org.springframework.boot.gradle.tasks.bundling.BootJar>("bootJar") {
this.archiveFileName.set("app.jar")
}