dependencies {
    // Project dependencies (internal modules)
    implementation project(':config')
    implementation project(':credentials')
    implementation project(':storage')

    // External dependencies
    implementation("ch.qos.logback:logback-classic:${logback_version}")
    implementation("ch.qos.logback:logback-core:${logback_version}")
    implementation("com.amazonaws:aws-java-sdk-core:${aws_java_sdk_version}")
    implementation("com.amazonaws:aws-java-sdk-sts:${aws_java_sdk_version}")
    implementation("com.auth0:java-jwt:${auth0_java_version}")
    implementation("com.auth0:jwks-rsa:${auth0_jwks_version}")
    implementation("com.azure:azure-identity:${azure_version}")
    implementation("com.epam.deltix:gflog-api:${epam_deltix_gflog_version}")
    implementation("com.epam.deltix:gflog-core:${epam_deltix_gflog_version}")
    implementation("com.fasterxml.jackson.core:jackson-databind:${jackson_core_version}")
    implementation("com.google.auth:google-auth-library-oauth2-http:${google_auth_version}")
    implementation("com.google.protobuf:protobuf-java:${google_protobuf_version}")
    implementation("com.jayway.jsonpath:json-path:${jayway_jsonpath_version}")
    implementation("com.networknt:json-schema-validator:${networknt_version}")
    implementation("io.micrometer:micrometer-registry-otlp:${micrometer_version}")
    implementation("io.micrometer:micrometer-registry-prometheus:${micrometer_version}")
    implementation("io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0:${opentelemetry_instrumentation_version}")
    implementation("io.opentelemetry:opentelemetry-api:${opentelemetry_version}")
    implementation("io.opentelemetry:opentelemetry-context:${opentelemetry_version}")
    implementation("io.opentelemetry:opentelemetry-exporter-otlp:${opentelemetry_version}")
    implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${opentelemetry_version}")
    implementation("io.vertx:vertx-config:${vertx_version}")
    implementation("io.vertx:vertx-core:${vertx_version}")
    implementation("io.vertx:vertx-micrometer-metrics:${vertx_version}")
    implementation("io.vertx:vertx-opentelemetry:${vertx_version}")
    implementation("jakarta.validation:jakarta.validation-api:${jakarta_validation_version}") // Ensure you have Jakarta Validation API dependency
    implementation("net.logstash.logback:logstash-logback-encoder:${logstash_logback_version}")
    implementation("org.apache.commons:commons-lang3:${apache_commons_version}")
    implementation("org.apache.httpcomponents.client5:httpclient5:${apache_httpclient5_version}")
    implementation("org.apache.jclouds.api:filesystem:${apache_jclouds_version}")
    implementation("org.apache.jclouds:jclouds-allblobstore:${apache_jclouds_version}")
    implementation("org.codehaus.janino:janino:${codehaus_janino_version}")
    implementation("org.glassfish:jakarta.el:${glassfish_jakarta_version}")
    implementation("org.hibernate.validator:hibernate-validator:${hibernate_validator_version}")
    implementation("org.redisson:redisson:${redisson_version}")
    implementation("org.slf4j:slf4j-api:${slf4j_version}")

    // Test dependencies
    testImplementation("com.github.codemonstur:embedded-redis:${github_codemonstur_embedded_redis}") {
        exclude group: 'org.slf4j', module: 'slf4j-simple'
    }
    testImplementation("com.squareup.okhttp3:mockwebserver:${squareup_okhttp3_version}")
    testImplementation("commons-io:commons-io:${commons_io_version}")
    testImplementation("io.vertx:vertx-junit5:${vertx_version}")
    testImplementation("io.vertx:vertx-web-client:${vertx_version}")
    testImplementation("org.junit.jupiter:junit-jupiter-api:${junit_version}")
    testImplementation("org.mockito:mockito-core:${mockito_version}")
    testImplementation("org.mockito:mockito-junit-jupiter:${mockito_version}")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junit_version}")

}

application {
    mainClass = 'com.epam.aidial.core.server.AiDial'
}

distributions {
    // write current version to the version file
    beforeEvaluate {
        def versionFile = file("$projectDir/src/main/resources/version")
        versionFile.getParentFile().mkdirs()
        versionFile.createNewFile()
        versionFile.write(version)
    }
}

test {
    testLogging {
        events "passed", "skipped", "failed", "standardOut", "standardError"
        exceptionFormat = "full"
    }
    useJUnitPlatform()
}
