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

// Explicitly allow slf4j to be included in this jar.
shadowIncludeSlf4j = true

dependencies {
  implementation project(path: ":kudu-proto")
  implementation(libs.hadoopCommon) {
    // Exclude io.netty to ensure we use our own versions.
    // The dependency on io.netty is a transitive one through the chain
    // hadoop-common --> hadoop-auth --> zookeeper --> io.netty.netty-xxx
    exclude group: "io.netty"
    // hadoopCommon and rangerPlugin use different versions of jersey.
    exclude group: "com.sun.jersey"
    // Exclude log4j and slf4j to ensure we use our own versions.
    exclude group: "log4j"
    exclude group: "org.slf4j"
  }
  implementation libs.protobufJavaUtil

  implementation(libs.rangerPlugin) {
    // rangerPlugin depends on kafka which includes different versions
    // of jersey than rangerPlugin.
    exclude group: "org.apache.kafka"
    // Exclude log4j and slf4j to ensure we use our own versions.
    exclude group: "log4j"
    exclude group: "org.slf4j"
  }
  implementation libs.slf4jApi
  implementation libs.log4jApi
  implementation libs.log4jCore
  implementation libs.log4jCompat
  implementation libs.log4jSlf4jImpl

  // Compiling exact modules from the io.netty group for hadoop-common:
  // for some reason, if compiling just the libs.netty umbrella package
  // (i.e. io.netty:netty-all), hadoop-common still depends on its own
  // version of io.netty:netty-transport-native-epoll.
  implementation libs.nettyBuffer
  implementation libs.nettyCommon
  implementation libs.nettyHandler
  implementation libs.nettyTransport
  implementation libs.nettyTransportEpoll
  implementation libs.nettyTransportUnix

  compileOnly libs.jsr305
  implementation libs.yetusAnnotations

  testImplementation project(path: ":kudu-test-utils", configuration: "shadow")
  testImplementation libs.junit
  testImplementation libs.mockitoCore
}

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

// Skip publishing kudu-subprocess artifact because it's not intended for external use.
publish.enabled = false
publishToMavenLocal.enabled = false
