126 lines
3.3 KiB
Kotlin
126 lines
3.3 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.kotlin)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
alias(libs.plugins.ksp)
|
|
alias(libs.plugins.shadow)
|
|
id("application")
|
|
}
|
|
|
|
group = "com.mtusi.messenger"
|
|
version = "2.0.0"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.kotlinx.serialization.hocon)
|
|
implementation(libs.logback.classic)
|
|
|
|
implementation(ktorLibs.server.core)
|
|
implementation(ktorLibs.server.netty)
|
|
implementation(ktorLibs.server.auth)
|
|
implementation(ktorLibs.server.contentNegotiation)
|
|
implementation(ktorLibs.server.statusPages)
|
|
implementation(ktorLibs.server.callLogging)
|
|
implementation(ktorLibs.server.defaultHeaders)
|
|
implementation(ktorLibs.server.cors)
|
|
implementation(ktorLibs.server.swagger)
|
|
implementation(ktorLibs.serialization.kotlinx.json)
|
|
|
|
implementation(libs.koin.core)
|
|
implementation(libs.koin.ktor)
|
|
implementation(libs.koin.annotations)
|
|
ksp(libs.koin.compiler)
|
|
|
|
implementation(libs.exposed.core)
|
|
implementation(libs.exposed.jdbc)
|
|
implementation(libs.exposed.kotlin.datetime)
|
|
implementation(libs.exposed.migration.core)
|
|
implementation(libs.exposed.migration.jdbc)
|
|
|
|
implementation(libs.postgres)
|
|
implementation(libs.hikaricp)
|
|
implementation(libs.flyway)
|
|
implementation(libs.flyway.postgresql)
|
|
|
|
implementation(libs.lettuce)
|
|
implementation(awssdk.services.s3)
|
|
|
|
implementation(libs.bouncycastle)
|
|
|
|
testImplementation(kotlin("test"))
|
|
testImplementation(ktorLibs.server.testHost)
|
|
testImplementation(ktorLibs.client.contentNegotiation)
|
|
testImplementation(libs.kotlinx.coroutines.test)
|
|
testImplementation(libs.koin.test)
|
|
testImplementation(libs.testContainers)
|
|
testImplementation(libs.testContainers.postgresql)
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(21)
|
|
}
|
|
|
|
ksp {
|
|
arg("KOIN_CONFIG_CHECK", "true")
|
|
arg("KOIN_DEFAULT_MODULE", "false")
|
|
}
|
|
|
|
application {
|
|
mainClass = "com.mtusi.messenger.main.AppKt"
|
|
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=false")
|
|
}
|
|
|
|
sourceSets {
|
|
named("main") {
|
|
resources {
|
|
srcDir(layout.projectDirectory.dir("contracts"))
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
shadowJar {
|
|
archiveBaseName = "messenger"
|
|
archiveClassifier = ""
|
|
archiveVersion = ""
|
|
mergeServiceFiles()
|
|
}
|
|
|
|
getByName<JavaExec>("run") {
|
|
|
|
workingDir = file("run/development")
|
|
|
|
doFirst {
|
|
val configDir = file("run/development/config")
|
|
configDir.mkdirs()
|
|
file("run/_template/config").listFiles()
|
|
?.filter { it.isFile && it.extension == "conf" }
|
|
?.forEach { template ->
|
|
val target = configDir.resolve(template.name)
|
|
if (!target.exists()) template.copyTo(target)
|
|
}
|
|
|
|
args = configDir.listFiles()
|
|
?.filter { it.extension == "conf" }
|
|
?.sortedBy { it.name }
|
|
?.map { "-config=config/${it.name}" }
|
|
?: emptyList()
|
|
}
|
|
}
|
|
|
|
register<JavaExec>("generateMigration") {
|
|
group = "database"
|
|
description = "Generates a new migration"
|
|
|
|
classpath = sourceSets["main"].runtimeClasspath
|
|
mainClass.set("com.mtusi.messenger.main.plugins.DatabaseKt")
|
|
}
|
|
}
|