import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion



compileTestFixturesKotlin {
    compilerOptions {
        jvmTarget = JvmTarget.JVM_21
        languageVersion = KotlinVersion.KOTLIN_1_9
        allWarningsAsErrors = false
        freeCompilerArgs = ["-Xjvm-default=all"]
    }
    dependsOn {
        tasks.matching { it.name == 'generate' }
    }
}

compileTestKotlin {
    compilerOptions {
        jvmTarget = JvmTarget.JVM_21
        languageVersion = KotlinVersion.KOTLIN_1_9
        allWarningsAsErrors = false
        freeCompilerArgs = ["-Xjvm-default=all"]
    }
    dependsOn {
        tasks.matching { it.name == 'generate' }
    }
}

dependencies {

    api 'com.datadoghq:dd-trace-api:1.39.0'
    api 'com.datadoghq:dd-trace-ot:1.39.0'
    api 'com.zaxxer:HikariCP:5.1.0'
    api 'org.jooq:jooq:3.19.11'
    api 'org.apache.commons:commons-csv:1.11.0'
    api 'org.apache.mina:mina-core:2.0.27' // for fixing vulnerability of sshd-mina

    implementation project(':airbyte-cdk:java:airbyte-cdk:airbyte-cdk-dependencies')

    implementation 'commons-cli:commons-cli:1.9.0'
    implementation 'io.aesy:datasize:1.0.0'
    implementation 'net.i2p.crypto:eddsa:0.3.0'
    implementation 'org.apache.httpcomponents:httpcore:4.4.16'
    implementation 'org.apache.logging.log4j:log4j-layout-template-json:2.24.0'
    implementation 'org.apache.sshd:sshd-mina:2.13.2'
    // bouncycastle is pinned to version-match the transitive dependency from kubernetes client-java
    // because a version conflict causes "parameter object not a ECParameterSpec" on ssh tunnel initiation
    implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'
    implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
    implementation 'org.bouncycastle:bctls-jdk18on:1.78.1'

    testFixturesApi 'org.testcontainers:testcontainers:1.20.1'
    testFixturesApi 'org.testcontainers:jdbc:1.20.1'

    testImplementation project(':airbyte-cdk:java:airbyte-cdk:airbyte-cdk-dependencies')
    testImplementation testFixtures(project(':airbyte-cdk:java:airbyte-cdk:airbyte-cdk-db-sources'))
    testImplementation testFixtures(project(':airbyte-cdk:java:airbyte-cdk:airbyte-cdk-datastore-postgres'))

    testImplementation 'mysql:mysql-connector-java:8.0.33'
    testImplementation 'org.postgresql:postgresql:42.7.3'
    testImplementation 'org.testcontainers:mysql:1.20.1'
    testImplementation 'org.testcontainers:postgresql:1.20.1'
    testImplementation 'org.xbib.elasticsearch:joptsimple:6.3.2.1'
    testImplementation 'org.mockito.kotlin:mockito-kotlin:5.4.0'
}
