buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'me.tatarka:gradle-retrolambda:3.2.3'
  }
}

apply plugin: 'com.android.library'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'

android {
  defaultPublishConfig "debug"

  def globalConfiguration = rootProject.extensions.getByName("ext")

  compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion")
  buildToolsVersion globalConfiguration.getAt("androidBuildToolsVersion")

  defaultConfig {
    minSdkVersion globalConfiguration.getAt("androidMinSdkVersion")
    targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion")
    versionCode globalConfiguration.getAt("androidVersionCode")
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  packagingOptions {
    exclude 'LICENSE.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
  }

  lintOptions {
    quiet true
    abortOnError false
    ignoreWarnings true
    disable 'InvalidPackage'  // Some libraries have issues with this
    disable 'OldTargetApi'    // Due to Robolectric that modifies the manifest when running tests
  }
}

dependencies {
  def dataDependencies = rootProject.ext.dataDependencies
  def testDependencies = rootProject.ext.dataTestDependencies

  compile project(':domain')
  provided dataDependencies.javaxAnnotation
  compile dataDependencies.javaxInject
  compile dataDependencies.okHttp
  compile dataDependencies.gson
  compile dataDependencies.rxJava
  compile dataDependencies.rxAndroid
  compile dataDependencies.androidAnnotations

  testCompile testDependencies.junit
  testCompile testDependencies.assertj
  testCompile testDependencies.mockito
  testCompile testDependencies.robolectric
}
