2024-03-07 11:12:52 +00:00
|
|
|
plugins {
|
|
|
|
kotlin("jvm") version "1.9.22"
|
|
|
|
id("com.google.protobuf") version "0.9.4"
|
2024-03-10 03:47:51 +00:00
|
|
|
kotlin("plugin.serialization") version "1.9.22"
|
|
|
|
id("io.ktor.plugin") version "2.3.8"
|
2024-03-07 11:12:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "dev.usbharu"
|
2024-03-10 03:47:51 +00:00
|
|
|
version = "1.0-SNAPSHOT"
|
2024-03-07 11:12:52 +00:00
|
|
|
|
|
|
|
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")
|
2024-03-10 03:47:51 +00:00
|
|
|
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)
|
2024-03-07 11:12:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|