forked from navikt/narmesteleder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
154 lines (130 loc) · 5.4 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.hidetake.gradle.swagger.generator.GenerateSwaggerUI
group = "no.nav.syfo"
version = "1.0.0"
val coroutinesVersion = "1.7.0"
val jacksonVersion = "2.15.0"
val kluentVersion = "1.73"
val ktorVersion = "2.3.0"
val logbackVersion = "1.4.6"
val logstashEncoderVersion = "7.3"
val prometheusVersion = "0.16.0"
val kotestVersion = "5.6.1"
val smCommonVersion = "1.0.1"
val mockkVersion = "1.13.5"
val nimbusdsVersion = "9.31"
val testContainerKafkaVersion = "1.18.0"
val postgresVersion = "42.6.0"
val flywayVersion = "9.17.0"
val hikariVersion = "5.0.1"
val testContainerPostgresVersion = "1.18.0"
val swaggerUiVersion = "4.18.2"
val jedisVersion = "4.4.0"
val kotlinVersion = "1.8.21"
val confluentVersion = "7.4.0"
val commonsCodecVersion = "1.15"
plugins {
id("org.jmailen.kotlinter") version "3.14.0"
kotlin("jvm") version "1.8.21"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.hidetake.swagger.generator") version "2.19.2" apply true
}
val githubUser: String by project
val githubPassword: String by project
repositories {
mavenCentral()
maven(url = "https://packages.confluent.io/maven/")
maven {
url = uri("https://maven.pkg.github.com/navikt/syfosm-common")
credentials {
username = githubUser
password = githubPassword
}
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutinesVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-call-id:$ktorVersion")
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
//This is to override version that is in io.ktor:ktor-client-apache
implementation("commons-codec:commons-codec:$commonsCodecVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("no.nav.helse:syfosm-common-kafka:$smCommonVersion")
implementation("io.confluent:kafka-avro-serializer:$confluentVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
implementation("com.fasterxml.jackson.module:jackson-module-jaxb-annotations:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("redis.clients:jedis:$jedisVersion")
swaggerUI("org.webjars:swagger-ui:$swaggerUiVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("com.nimbusds:nimbus-jose-jwt:$nimbusdsVersion")
testImplementation("org.testcontainers:kafka:$testContainerKafkaVersion")
testImplementation("org.testcontainers:postgresql:$testContainerPostgresVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") {
exclude(group = "org.eclipse.jetty")
}
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
}
swaggerSources {
create("narmesteleder").apply {
setInputFile(file("api/oas3/narmesteleder-api.yaml"))
}
}
tasks {
withType<Jar> {
manifest.attributes["Main-Class"] = "no.nav.syfo.BootstrapKt"
}
create("printVersion") {
doLast {
println(project.version)
}
}
withType<KotlinCompile> {
dependsOn("generateSwaggerUI")
kotlinOptions.jvmTarget = "17"
}
withType<GenerateSwaggerUI> {
outputDir = File(buildDir.path + "/resources/main/api")
}
withType<ShadowJar> {
transform(ServiceFileTransformer::class.java) {
setPath("META-INF/cxf")
include("bus-extensions.txt")
}
}
withType<Test> {
useJUnitPlatform {
}
testLogging {
events("skipped", "failed")
showStackTraces = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
"check" {
dependsOn("formatKotlin")
}
}