/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

plugins {
    id('java-library')
}

version project.version
sourceCompatibility = JavaVersion.VERSION_11

test {
    useJUnitPlatform()
}

dependencies {
    implementation(project(":adapters:adapters-base"))
    implementation(project(":adapters:adapters-cassandra41"))

    // Needed by the Cassandra dtest framework
    // JUnit
    api("org.junit.jupiter:junit-jupiter-api:${project.junitVersion}")
    api("org.junit.jupiter:junit-jupiter-params:${project.junitVersion}")
    api("org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}")

    api("org.junit.vintage:junit-vintage-engine:${junitVersion}")
    api('org.mockito:mockito-inline:4.10.0')
    api("org.assertj:assertj-core:${assertjCoreVersion}")

    api('com.datastax.cassandra:cassandra-driver-core:3.11.5')
    implementation("com.google.inject:guice:${guiceVersion}")

    implementation("com.google.guava:guava:27.0.1-jre")
    api("io.vertx:vertx-web:${project.vertxVersion}") {
        exclude group: 'junit', module: 'junit'
    }
    implementation("io.vertx:vertx-web-client:${project.vertxVersion}")
    implementation(group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.14.3')

    api(testFixtures(project(path: ":test-common")))

    testImplementation(platform("org.junit:junit-bom:${project.junitVersion}"))
    testImplementation('org.junit.jupiter:junit-jupiter')
    testImplementation("org.assertj:assertj-core:${assertjCoreVersion}")

    compileOnly(group: 'com.intellij', name: 'annotations', version: '12.0')

    // Exposed to the test project
    api("io.vertx:vertx-junit5:${project.vertxVersion}")
    // The server itself
    api(project(path: ":server"))
    api(project(path: ":server-common"))
}

compileJava.onlyIf { !skipIntegrationTest }
compileTestJava.onlyIf { !skipIntegrationTest }
javadoc.onlyIf { !skipIntegrationTest }
