apply plugin: 'kotlin'
apply plugin: 'java'

//noinspection GroovyUnusedAssignment
sourceCompatibility = rootProject.extensions.ext.compiler.java
//noinspection GroovyUnusedAssignment
targetCompatibility = rootProject.extensions.ext.compiler.java

configurations {
  provided
}

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

  main {
    compileClasspath += configurations.provided
  }
}

dependencies {
  def domainDependencies = rootProject.ext.domainDependencies
  def domainTestDependencies = rootProject.ext.domainTestDependencies

  compileOnly domainDependencies.daggerCompiler
  compileOnly domainDependencies.javaxAnnotation

  implementation domainDependencies.kotlinStdLib
  implementation domainDependencies.kotlinReflect
  implementation domainDependencies.dagger
  implementation domainDependencies.rxJava

  testImplementation domainDependencies.kotlinStdLib
  testImplementation domainTestDependencies.junitKotlin
  testImplementation domainTestDependencies.junit
  testImplementation domainTestDependencies.mockitoKotlin
  testImplementation domainTestDependencies.hamkrest
  // AS is not adding the test resources to the classpath when executing from UI for Java Modules.
  // https://code.google.com/p/android/issues/detail?id=64887
  testRuntime files('build/resources/test')
}
