-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
81 lines (72 loc) · 2.78 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
import org.jetbrains.kotlin.daemon.common.trimQuotes
val konfigVersion = "1.6.10.0"
val ktorVersion = "3.0.3"
val logstashVersion = "8.0"
val logbackVersion = "1.5.16"
val opentelemetryVersion = "1.46.0"
val opentelemetryKtorVersion = "2.11.0-alpha"
plugins {
application
kotlin("jvm") version "2.1.0"
//id("org.jmailen.kotlinter") version "4.5.0"
id("com.github.ben-manes.versions") version "0.51.0"
id("com.gradleup.shadow") version "8.3.5" apply false
}
allprojects {
group = "io.nais"
version = "1.0.0"
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "application")
apply(plugin = "kotlin")
//apply(plugin = "org.jmailen.kotlinter")
apply(plugin = "com.gradleup.shadow")
application {
mainClass.set("io.nais.WonderwalledKt")
}
tasks {
kotlin {
jvmToolchain(21)
}
jar {
manifest {
attributes["Main-Class"] = "io.nais.WonderwalledKt"
}
}
/*lintKotlin {
dependsOn("formatKotlin")
}*/
withType<JavaExec>().named("run") {
environment = file("$rootDir/.env")
.takeIf { it.exists() }
?.readLines()
?.filterNot { it.isEmpty() || it.startsWith("#") }
?.associate {
val (key, value) = it.split("=")
key to value.trimQuotes()
} ?: emptyMap()
environment("OTEL_SERVICE_NAME", project.name)
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation("io.ktor:ktor-server:${ktorVersion}")
implementation("io.ktor:ktor-server-cio:${ktorVersion}")
implementation("io.ktor:ktor-server-content-negotiation:${ktorVersion}")
implementation("io.ktor:ktor-serialization-jackson:${ktorVersion}")
implementation("io.ktor:ktor-client-cio:${ktorVersion}")
implementation("io.ktor:ktor-client-core:${ktorVersion}")
implementation("io.ktor:ktor-client-content-negotiation:${ktorVersion}")
implementation("com.natpryce:konfig:${konfigVersion}")
implementation("io.opentelemetry.instrumentation:opentelemetry-ktor-3.0:${opentelemetryKtorVersion}")
implementation("io.opentelemetry:opentelemetry-sdk:${opentelemetryVersion}")
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:$opentelemetryVersion");
implementation("io.opentelemetry:opentelemetry-exporter-otlp:${opentelemetryVersion}")
implementation("io.opentelemetry:opentelemetry-extension-kotlin:${opentelemetryVersion}")
implementation("net.logstash.logback:logstash-logback-encoder:${logstashVersion}")
runtimeOnly("ch.qos.logback:logback-classic:${logbackVersion}")
}
}