-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
132 lines (112 loc) · 4.02 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
val slf4jVersion = "2.0.17"
val ktorVersion = "3.1.2"
val micrometerRegistryPrometheusVersion = "1.14.5"
val junitJupiterVersion = "5.12.1"
val logbackClassicVersion = "1.5.18"
val logbackEncoderVersion = "8.0"
val awaitilityVersion = "4.2.2"
val kafkaTestcontainerVersion = "1.20.6"
val tbdLibsVersion = "2025.03.30-14.11-a91ce546"
group = "com.github.navikt"
version = properties["version"] ?: "local-build"
plugins {
kotlin("jvm") version "2.1.20"
id("java")
id("maven-publish")
}
dependencies {
api("org.slf4j:slf4j-api:$slf4jVersion")
api("com.github.navikt.tbd-libs:rapids-and-rivers:$tbdLibsVersion")
api("io.ktor:ktor-server-cio:$ktorVersion")
api("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
api("io.micrometer:micrometer-registry-prometheus:$micrometerRegistryPrometheusVersion")
api("ch.qos.logback:logback-classic:$logbackClassicVersion")
api("net.logstash.logback:logstash-logback-encoder:$logbackEncoderVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("com.github.navikt.tbd-libs:rapids-and-rivers-test:$tbdLibsVersion")
testImplementation("org.testcontainers:kafka:$kafkaTestcontainerVersion")
testImplementation("org.awaitility:awaitility:$awaitilityVersion")
}
java {
withSourcesJar()
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("21"))
}
}
tasks {
jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
withType<Test> {
useJUnitPlatform()
testLogging {
events("skipped", "failed")
showExceptions = true
showStackTraces = true
showCauses = true
exceptionFormat = TestExceptionFormat.FULL
showStandardStreams = true
}
}
}
repositories {
val githubPassword: String? by project
mavenCentral()
/* ihht. https://github.com/navikt/utvikling/blob/main/docs/teknisk/Konsumere%20biblioteker%20fra%20Github%20Package%20Registry.md
så plasseres github-maven-repo (med autentisering) før nav-mirror slik at github actions kan anvende førstnevnte.
Det er fordi nav-mirroret kjører i Google Cloud og da ville man ellers fått unødvendige utgifter til datatrafikk mellom Google Cloud og GitHub
*/
maven {
url = uri("https://maven.pkg.github.com/navikt/maven-release")
credentials {
username = "x-access-token"
password = githubPassword
}
}
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
val githubUser: String? by project
val githubPassword: String? by project
publishing {
repositories {
maven {
url = uri("https://maven.pkg.github.com/navikt/rapids-and-rivers")
credentials {
username = githubUser
password = githubPassword
}
}
}
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set("rapids-rivers")
description.set("Rapids and Rivers")
url.set("https://github.com/navikt/rapids-and-rivers")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
scm {
connection.set("scm:git:https://github.com/navikt/rapids-and-rivers.git")
developerConnection.set("scm:git:https://github.com/navikt/rapids-and-rivers.git")
url.set("https://github.com/navikt/rapids-and-rivers")
}
}
from(components["java"])
}
}
}