/*
 * 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 plugin: 'java'

dependencies {
  compile project(":gobblin-api")
  compile project(":gobblin-core-base")
  compile project(":gobblin-utility")
  compile project(":gobblin-metrics-libs:gobblin-metrics")
  compile project(path: ":gobblin-modules:gobblin-elasticsearch-deps", configuration:"shadow")

  compile "org.apache.logging.log4j:log4j-to-slf4j:2.7"
  compile "org.slf4j:slf4j-api:1.7.21"
  compile externalDependency.avro
  compile externalDependency.jacksonCore
  compile externalDependency.jacksonMapper
  compile externalDependency.commonsHttpClient
  compile externalDependency.commonsPool
  compile externalDependency.commonsLang3
  compile externalDependency.slf4j
  compile externalDependency.httpclient
  compile externalDependency.httpcore
  compile externalDependency.metricsCore
  compile externalDependency.typesafeConfig
  compile externalDependency.findBugsAnnotations

  testCompile project(":gobblin-runtime")
  testCompile project(":gobblin-test-utils")
  testCompile externalDependency.jsonAssert
  testCompile externalDependency.mockito
  testCompile externalDependency.testng
}

task installTestDependencies(type:Exec) {
  workingDir "${project.rootDir}/gobblin-modules/gobblin-elasticsearch/"
  commandLine './scripts/install_test_deps.sh'
}

task uninstallTestDependencies(type: Exec) {
  workingDir "${project.rootDir}/gobblin-modules/gobblin-elasticsearch/"
  commandLine './scripts/uninstall_test_deps.sh'
  
}

test.dependsOn installTestDependencies
test.finalizedBy uninstallTestDependencies

configurations {
  compile {
    transitive = false 
  }
}

test {
  workingDir rootProject.rootDir
  maxParallelForks = 4
}


ext.classification="library"
