plugins {
    id "idea"
    id "java-library"
    id "org.jetbrains.kotlin.kapt" version "1.9.25"
    id "org.jetbrains.kotlin.jvm" version "1.9.25"
    id "org.jetbrains.kotlin.plugin.spring" version "1.9.25"
    id "org.springframework.boot" version "3.3.4"
    id "io.spring.dependency-management" version "1.1.6"
    id "com.adarshr.test-logger" version "3.2.0"
}

ext {
    testContainerVersion = "1.20.4"
}

[compileKotlin, compileTestKotlin]*.kotlinOptions*.jvmTarget = "17"

repositories {
    mavenCentral()
}

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

dependencies {
    implementation "org.springframework.boot:spring-boot-starter-actuator"
    implementation "org.springframework.boot:spring-boot-starter-websocket"
    implementation "org.springframework.boot:spring-boot-starter-logging"
    implementation "org.springframework.boot:spring-boot-starter-security"
    implementation "org.springframework.security:spring-security-messaging"
    implementation "org.springframework.boot:spring-boot-starter-data-redis"

    implementation "io.lettuce:lettuce-core"
    implementation "io.projectreactor.netty:reactor-netty"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    implementation "org.jetbrains.kotlin:kotlin-reflect"

    kapt "org.springframework.boot:spring-boot-configuration-processor"

    testImplementation "com.google.code.gson:gson"
    testImplementation "org.springframework.boot:spring-boot-starter-test"
    testImplementation "org.testcontainers:junit-jupiter:$testContainerVersion"
    testImplementation "org.testcontainers:postgresql:$testContainerVersion"
}

test {
    useJUnitPlatform()
    testLogging {
        showStandardStreams = true
    }
}

testlogger {
    theme "mocha"
}

bootJar {
    archiveFileName = "${project.name}.jar"
}
