import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
    id "checkstyle"
    id "jacoco"
    id "io.freefair.lombok"
    id "java-library"
    id "io.freefair.maven-optional"
    id "io.freefair.javadoc-links"
    id "io.freefair.maven-publish-java"
}

description = "OkHttp Spring Boot AutoConfigure"

tasks.named('compileJava') {
    inputs.files(processResources)
}

tasks.named('jacocoTestReport', JacocoReport) {
    reports.xml.required = true
}

dependencies {
    api platform(SpringBootPlugin.BOM_COORDINATES)
    annotationProcessor platform(SpringBootPlugin.BOM_COORDINATES)

    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor'

    api 'org.springframework.boot:spring-boot-autoconfigure'
    implementation 'org.slf4j:slf4j-api'

    optional project(':okhttp-spring-client')
    optional 'org.springframework:spring-web'
    optional 'org.springframework.boot:spring-boot-starter-actuator'

    optional platform('com.squareup.okhttp3:okhttp-bom:4.12.0')
    optional 'com.squareup.okhttp3:okhttp'
    optional 'com.squareup.okhttp3:logging-interceptor'

    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

tasks.named('test', Test) {
    useJUnitPlatform()
}
