apply plugin: 'com.jfrog.bintray'

// Includes 'scala' plugin
apply from: "$rootDir/airlearner/configs/scala212.gradle"

repositories {
  mavenLocal()
}

dependencies {
  compile libraries.typesafe_config

  provided "org.apache.spark:spark-core_2.12:${sparkVersion}"
  provided "org.apache.spark:spark-hive_2.12:${sparkVersion}"
  provided "org.apache.spark:spark-mllib_2.12:${sparkVersion}"

  compile project(':airlearner:airlearner-utils')

  ////////////////////
  // Test-specific dependencies
  ////////////////////
  testCompile project(':airlearner:airlearner-utils')
  testCompile project(':airlearner:airlearner-utils').sourceSets.test.output
}

bintray {
  user = System.env.BINTRAY_USER ?: bintray_user
  key = System.env.BINTRAY_KEY ?: bintray_key
  configurations = ['published', 'archives']
  publish = project.publish
  dryRun = project.dryRun
  override = true

  pkg {
    repo = 'aerosolve'
    userOrg = 'airbnb'
    name = 'airlearner-strategy'
    desc = 'airlearner strategy model'
    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', 'binary regression', 'spark', 'scala']
    attributes= ['plat': ['linux', 'osx']]
    publicDownloadNumbers = true
  }

}

shadowJar {
  zip64 = true
}

configurations {
  // Spark seems to include this already. Including this sometimes creates a conflict.
  testCompile.exclude module: 'jackson-databind'
  testCompile.exclude group: 'org.apache.avro'
}
