unos/watch-dog-be/build.gradle.kts

71 lines
2.0 KiB
Plaintext

plugins {
kotlin("jvm") version "1.9.22"
id("com.google.protobuf") version "0.9.4"
kotlin("plugin.serialization") version "1.9.22"
id("io.ktor.plugin") version "2.3.8"
}
group = "dev.usbharu"
version = "1.0-SNAPSHOT"
application {
mainClass.set("io.ktor.server.netty.EngineMain")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
}
dependencies {
implementation("io.grpc:grpc-kotlin-stub:1.4.1")
implementation("io.grpc:grpc-protobuf:1.61.1")
implementation("com.google.protobuf:protobuf-kotlin:3.25.3")
implementation("io.grpc:grpc-netty:1.61.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
protobuf(files("../unos-proto/src/main/proto/watchdog"))
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation("org.mongodb:mongodb-driver-kotlin-coroutine:5.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.3")
implementation("org.mongodb:bson-kotlinx:5.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
implementation("dev.usbharu.unos:utils")
implementation("io.ktor:ktor-server-core-jvm")
implementation("io.ktor:ktor-server-content-negotiation-jvm")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm")
implementation("io.ktor:ktor-server-netty-jvm")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.3"
}
plugins {
create("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.61.1"
}
create("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.4.1:jdk8@jar"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
create("grpc")
create("grpckt")
}
it.builtins {
create("kotlin")
}
}
}
}