plugins {
    id "code-quality-conventions"
    id "java-conventions"
    id "sbom-conventions"
    id "release-conventions"
}

dependencies {
    annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
    annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

    api project(":arconia-core")
    api "io.micrometer:micrometer-observation"
    api "io.opentelemetry:opentelemetry-sdk"
    api "io.opentelemetry.semconv:opentelemetry-semconv:${openTelemetrySemanticConventionsVersion}"

    implementation "org.springframework.boot:spring-boot-starter"

    // OpenTelemetry
    optional("io.opentelemetry:opentelemetry-exporter-otlp") {
        exclude group: "io.opentelemetry", module: "opentelemetry-exporter-sender-okhttp"
    }
    optional "io.opentelemetry:opentelemetry-exporter-logging"

    // Spring/Micrometer
    optional "io.micrometer:micrometer-registry-otlp"
    optional "io.micrometer:micrometer-tracing-bridge-otel"
    optional "org.springframework.boot:spring-boot-starter-actuator"

    // Testcontainers
    optional "org.springframework.boot:spring-boot-testcontainers"
    optional "org.testcontainers:grafana"

    testImplementation "org.springframework.boot:spring-boot-starter-test"
    testImplementation "io.opentelemetry:opentelemetry-exporter-sender-jdk"
    testImplementation "io.opentelemetry:opentelemetry-exporter-sender-grpc-managed-channel"
    testImplementation "org.testcontainers:junit-jupiter"
    testRuntimeOnly "io.grpc:grpc-netty-shaded:1.75.0"
    testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}

dependencyManagement {
    imports {
        mavenBom "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${openTelemetryInstrumentationVersion}-alpha"
    }
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            pom {
                name = "Arconia OpenTelemetry"
                description = "Arconia OpenTelemetry."
            }
        }
    }
}

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