plugins {
    id "java"
    id "io.micronaut.application" version "$micronautApplicationVersion"
}

version = findProperty('BUILD_VERSION') ?: 'latest'
group = "com.devsoap"

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

repositories {
    mavenCentral()
}

dependencies {

    annotationProcessor 'org.projectlombok:lombok'
    testAnnotationProcessor 'org.projectlombok:lombok'

    annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))
    testAnnotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))

    implementation(platform("io.micronaut:micronaut-bom:$micronautVersion"))
    implementation 'org.projectlombok:lombok'

    implementation 'com.fasterxml.jackson.core:jackson-databind'
    implementation 'javax.validation:validation-api'
    implementation 'io.micronaut.views:micronaut-views-handlebars'

    implementation "io.github.resilience4j:resilience4j-micronaut:$resilience4jVersion"
    implementation "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
    implementation "io.github.resilience4j:resilience4j-consumer:$resilience4jVersion"
    implementation "io.github.resilience4j:resilience4j-rxjava3:$resilience4jVersion"

    implementation "ch.qos.logback:logback-classic"
    implementation "org.slf4j:jul-to-slf4j:$julToSlf4jVersion"
    implementation "org.apache.commons:commons-lang3:$commonsLangVersion"

    runtimeOnly "org.webjars.npm:htmx.org:$htmxVersion"
    runtimeOnly "org.webjars.npm:hyperscript.org:$hyperscriptVersion"

    testImplementation 'org.junit.jupiter:junit-jupiter-params'
    testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
    testImplementation "org.assertj:assertj-core:$assertJVersion"
    testImplementation "org.reflections:reflections:$reflectionsVersion"
}

application {
    mainClass.set("com.devsoap.tincheck.Application")
}

micronaut {
    version "$micronautVersion"
    runtime("netty")
}

wrapper {
    gradleVersion = '8.0'
}

test {
    useJUnitPlatform()
    failFast = true
}