apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
  compileSdkVersion 25
  buildToolsVersion "25.0.3"

  defaultConfig {
    minSdkVersion 15
    //noinspection OldTargetApi
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

  }

  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }

  sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    test.java.srcDirs += 'src/test/kotlin'
  }

  lintOptions {
    disable 'InvalidPackage'
  }

  dexOptions {
    // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
    preDexLibraries = preDexEnabled && !travisBuild
  }
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile "com.android.support:support-annotations:$support_version"
  compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
  compile "io.reactivex:rxjava:$rxjava_version"
  compile "io.reactivex:rxandroid:$rxandroid_version"
  compile "com.squareup.okhttp3:logging-interceptor:$okhttp_ersion"
  compile "com.squareup.retrofit2:retrofit:$retrofit_version"
  compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
  compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"

  androidTestCompile("com.android.support.test.espresso:espresso-core:$espresso_version", {
    exclude group: 'com.android.support', module: 'support-annotations'
  })

  testCompile "junit:junit:$junit_version"
  testCompile "org.hamcrest:hamcrest-core:$hamcrest_version"
  testCompile "org.hamcrest:hamcrest-library:$hamcrest_version"
  testCompile "com.nhaarman:mockito-kotlin-kt1.1:$mockito_kotlin_version"
}
repositories {
  mavenCentral()
}

ext {
  bintrayRepo = 'android'
  bintrayName = 'rxplaces'
  organizationName = '99'

  publishedGroupId = 'com.a99.rxplaces'
  libraryName = 'library'
  artifact = 'library'

  libraryDescription = 'A Google Maps Webservice API made simple.'

  siteUrl = 'https://github.com/99Taxis/RxPlaces'
  gitUrl = 'https://github.com/99Taxis/RxPlaces.git'

  libraryVersion = '0.1.0-alpha3'

  developerId = '99Taxis'
  developerName = '99'
  developerEmail = 'mobile-dev@99taxis.com'

  licenseName = 'The Apache Software License, Version 2.0'
  licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  allLicenses = ["Apache-2.0"]
}

apply from: "../maven_plugin_setup.gradle"
apply from: "../bintray_plugin_setup.gradle"

tasks.withType(Javadoc) {
  enabled = false
}