/*
 * Copyright (c) 2016-present. Drakeet Xu
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: 'jacoco'
apply from: rootProject.file('gradle/publish-docs.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

android {
  compileSdkVersion buildConfig.compileSdkVersion

  defaultConfig {
    minSdkVersion buildConfig.minSdkVersion
  }

  compileOptions {
    kotlinOptions.freeCompilerArgs += ['-module-name', "multitype"]
  }

  // TODO replace with https://issuetracker.google.com/issues/72050365 once released.
  libraryVariants.all { variant ->
    variant.generateBuildConfigProvider.configure {
      it.enabled = false
    }
  }

  testOptions {
    unitTests {
      includeAndroidResources = true
    }
  }

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

dependencies {
  testImplementation 'junit:junit:4.13'
  testImplementation "org.robolectric:robolectric:4.3.1"
  testImplementation "org.mockito:mockito-inline:2.18.0"
  testImplementation "androidx.recyclerview:recyclerview:$recyclerviewVersion"
  testImplementation "com.google.truth:truth:1.0"
  testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"

  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
  api "androidx.annotation:annotation:$annotationVersion"
  api "androidx.recyclerview:recyclerview:$recyclerviewVersion"
}
