apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jmailen.kotlinter'

sourceCompatibility = 11

apply plugin: 'checkstyle'
apply from: '../publishing.gradle'

dependencies {
  implementation project(':deeplinkdispatch-base')
  implementation deps.jsr305
  implementation deps.javaPoet
  implementation deps.androidXAnnotations
  implementation deps.ksp
  implementation deps.xProcessor

  testImplementation deps.junit
  testImplementation deps.assertJ
  testImplementation deps.android
  // For test compile we need a reference of the DeepLinkDelegate (which has android dependencies)
  // Cannot depend on them from Maven as they are .aar and not .jar files (this is a java project)
  testImplementation fileTree(dir: 'libs', include: ['androidx.localbroadcastmanager-1.0.0-beta1.jar','androidx.core-1.0.0-beta1.jar'])
  testImplementation deps.compileTesting
  testImplementation deps.compileTestingKsp
  testImplementation deps.mockk
  testImplementation deps.kotlinReflect
}

checkstyle {
  configFile rootProject.file('checkstyle.xml')
  showViolations true
  configProperties = ['checkstyle.cache.file': rootProject.file('build/checkstyle.cache')]
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  kotlinOptions {
    jvmTarget = "11"
    freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
    freeCompilerArgs += "-Xopt-in=androidx.room.compiler.processing.ExperimentalProcessingApi"
  }
}