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

android {
  def ext = rootProject.extensions.ext

  compileSdkVersion ext.android.compileSdk

  defaultConfig {
    minSdkVersion ext.android.minSdk
    targetSdkVersion ext.android.targetSdk
    versionCode ext.application.versionCode
  }

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

  compileOptions {
    sourceCompatibility ext.compiler.java
    targetCompatibility ext.compiler.java
  }

  dexOptions {
    preDexLibraries false
  }

  // Avoid lint error validating Realm dependency
  lintOptions {
    ignore 'InvalidPackage'
  }
}

kapt {
  arguments {
    arg("realm.ignoreKotlinNullability", true)
  }
}

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

  implementation project(':domain')

  kapt dataDependencies.daggerCompiler
  compileOnly dataDependencies.javaxAnnotation
  implementation dataDependencies.kotlinStdLib
  implementation dataDependencies.kotlinReflect
  implementation dataDependencies.dagger
  implementation dataDependencies.rxJava
  implementation dataDependencies.rxAndroid
  implementation dataDependencies.androidAnnotations
  implementation dataDependencies.gson
  implementation dataDependencies.spongyCastle

  testImplementation testDependencies.kotlinStdLib
  testImplementation testDependencies.junitKotlin
  testImplementation testDependencies.junit
  testImplementation testDependencies.hamkrest
  testImplementation testDependencies.robolectric
  testImplementation testDependencies.mockitoKotlin
}
