// 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.

apply from: "$rootDir/gradle/shadow.gradle"

dependencies {
    // todo(zchovan) confirm if any dependencies should be shaded to avoid classpath issues
    implementation libs.flinkStreamingJava
    implementation libs.flinkConnectorKudu
    implementation libs.flinkCore
    implementation libs.flinkClients
    implementation libs.flinkConnectorBase
    implementation project(path: ":kudu-client", configuration: "shadow")

    testImplementation libs.junit
    testImplementation libs.assertj
    testImplementation project(path: ":kudu-test-utils", configuration: "shadow")
    testImplementation libs.log4jApi
    testImplementation libs.log4jCore
    testImplementation libs.log4jSlf4jImpl
    testImplementation libs.flinkTestUtils
}

shadowJar {
    dependencies {
        exclude(dependency("com.twitter::.*"))
        exclude(dependency("org.javassist::.*"))
        exclude(dependency("org.lz4::.*"))
        exclude(dependency("org.objenesis::.*"))
        exclude(dependency("org.xerial.snappy::.*"))
        exclude(dependency("org.yaml::.*"))
        exclude "META-INF/licenses/**"
        exclude "META-INF/services/org.apache.flink.*"
        exclude "assets/**"
        exclude "com/esotericsoftware/**"
        exclude "flink-jaas.conf"
        exclude "flink-rpc-akka.jar"
        exclude "javax/annotation/**"
        exclude "one/profiler/**"
        exclude "org/snakeyaml/**"
    }

    minimize()
}

// kudu-replication has no public Javadoc.
javadoc {
    enabled = false
}
