plugins {
  id 'me.champeau.gradle.jmh' version '0.3.1'
}

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

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

repositories {
  mavenLocal()
}

dependencies {
  compile libraries.joda_time
  compile libraries.joda_convert
  compile libraries.lombok
  compile libraries.slf4j_api
  compile libraries.slf4j_simple
  compile libraries.typesafe_config

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

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-utils'
    desc = 'airlearner utils lib'
    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
  }
}

shadowJar {
  zip64 = true
}

// Note: If you run into issues with JMH, your first response should be to run `gradlew clean`
jmh {
  jmhVersion = '1.19'
}
