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-14 05:10:52 +00:00
|
|
|
version = "1.0.0"
|
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")
|
2024-03-14 06:18:32 +00:00
|
|
|
implementation("io.ktor:ktor-server-cors")
|
2024-03-14 07:15:05 +00:00
|
|
|
implementation("io.ktor:ktor-server-call-logging")
|
2024-03-11 06:47:38 +00:00
|
|
|
implementation("ch.qos.logback:logback-classic:1.5.3")
|
2024-03-10 03:47:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-11 06:47:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
jib {
|
|
|
|
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
|
|
|
|
dockerClient.environment = mapOf(
|
|
|
|
"DOCKER_HOST" to "localhost:2375"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ktor {
|
|
|
|
docker {
|
|
|
|
localImageName.set("watchdog-be")
|
2024-03-14 05:22:56 +00:00
|
|
|
this.imageTag = version.toString()
|
2024-03-11 06:47:38 +00:00
|
|
|
}
|
2024-03-07 11:12:52 +00:00
|
|
|
}
|