apply from: '../dependencies.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
  compileSdkVersion versions.compileSdk
  buildToolsVersion versions.buildTools

  defaultConfig {
    applicationId "com.afollestad.nocknock"
    minSdkVersion versions.minSdk
    targetSdkVersion versions.compileSdk
    versionCode versions.publishVersionCode
    versionName versions.publishVersion
  }

  compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
  }

  packagingOptions {
    exclude 'META-INF/atomicfu.kotlin_module'
  }
}

dependencies {
  implementation project(':common')
  implementation project(':engine')
  implementation project(':data')
  implementation project(':notifications')
  implementation project(':viewcomponents')

  // Google/AppCompat
  implementation 'androidx.appcompat:appcompat:' + versions.androidxCore
  implementation 'androidx.recyclerview:recyclerview:' + versions.androidxRecyclerView
  implementation 'com.google.android.material:material:' + versions.googleMaterial
  implementation 'androidx.browser:browser:' + versions.androidxBrowser
  implementation 'com.google.firebase:firebase-core:' + versions.firebaseCore

  // Lifecycle
  kapt 'androidx.lifecycle:lifecycle-compiler:' + versions.lifecycle

  // Kotlin
  implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:' + versions.kotlin

  // JOIN
  implementation 'org.koin:koin-android:' + versions.koin
  implementation 'org.koin:koin-androidx-scope:' + versions.koin
  implementation 'org.koin:koin-androidx-viewmodel:' + versions.koin

  // afollestad
  implementation 'com.afollestad.material-dialogs:core:' + versions.materialDialogs

  // Debugging
  implementation 'com.jakewharton.timber:timber:' + versions.timber
  implementation("com.crashlytics.sdk.android:crashlytics:${versions.fabric}") {
    transitive = true
  }

  // Testing
  testImplementation 'junit:junit:' + versions.junit
  testImplementation 'org.mockito:mockito-core:' + versions.mockito
  testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:' + versions.mockitoKotlin
  testImplementation 'com.google.truth:truth:' + versions.truth
  testImplementation 'androidx.arch.core:core-testing:' + versions.archTesting

  // UI testing
  androidTestImplementation 'androidx.test:runner:' + versions.androidxTestRunner
  androidTestImplementation 'androidx.test:rules:' + versions.androidxTestRunner
}

apply from: '../spotless.gradle'
apply from: '../mock/mock.gradle'

apply plugin: "io.fabric"
apply plugin: 'com.google.gms.google-services'