apply plugin: "java"
apply plugin: "scala"
apply plugin: 'com.jfrog.bintray'

bintray {
  user = System.env.BINTRAY_USER ?: bintray_user
  key = System.env.BINTRAY_KEY ?: bintray_key
  configurations = ['published', 'archives']
  //publications = ['published']
  //filesSpec {
  //  from 'files'
  //  into 'standalone_files/level1'
  // rename '(.+)\\.(.+)', '$1-suffix.$2'
  //}
  publish = project.publish
  dryRun = project.dryRun

  pkg {
    repo = 'aerosolve'
    userOrg = 'airbnb'
    name = 'aerosolve-training'
    desc = 'Aerosolve machine learning library training module'
    websiteUrl = 'https://github.com/airbnb/aerosolve'
    issueTrackerUrl = 'https://github.com/airbnb/aerosolve/issues'
    vcsUrl = 'https://github.com/airbnb/aerosolve.git'
    licenses = ['Apache-2.0']
    labels = ['machine learning', 'spark', 'scala']
    attributes= ['plat': ['linux', 'osx']]
    publicDownloadNumbers = true
  }
}

dependencies {
  compile 'org.scala-lang:scala-library:2.12.7'
  compile project(':core')

  compile ('org.apache.avro:avro:1.7.7') {
    transitive = false
  }
  compile ('org.apache.avro:avro-mapred:1.7.7') {
    transitive = false
  }

  compile 'com.fasterxml.jackson.module:jackson-module-scala_2.12:2.11.4'
  compile 'joda-time:joda-time:2.5'
  compile 'org.apache.hadoop:hadoop-client:2.8.5'
  compile 'com.databricks:spark-csv_2.10:1.4.0'

  provided 'org.apache.spark:spark-core_2.12:3.1.1'
  provided 'org.apache.spark:spark-hive_2.12:3.1.1'

  testCompile 'org.apache.spark:spark-core_2.12:3.1.1'
  testCompile 'org.apache.spark:spark-core_2.12:3.1.1:tests'
  testCompile 'org.scalatest:scalatest_2.11:3.0.5'
  testCompile 'org.apache.spark:spark-hive_2.12:3.1.1'
  testCompile 'org.mockito:mockito-all:1.9.5'
  testCompile 'org.slf4j:slf4j-log4j12:1.7.21'
}

shadowJar {
  zip64 = true

  manifest {
    attributes 'Main-Class': 'com.airbnb.aerosolve.training.pipeline.JobRunner'
  }
}
