apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

dependencies {
  implementation project(':android-sdk-ui')
  implementation "androidx.appcompat:appcompat:${ANDROIDX_APPCOMPAT_VERSION}"
  implementation "androidx.preference:preference:${ANDROIDX_PREFERENCE_VERSION}"
  implementation "com.google.android.material:material:${GOOGLE_MATERIAL_VERSION}"
  implementation "androidx.swiperefreshlayout:swiperefreshlayout:${ANDROIDX_SWIPE_REFRESH_LAYOUT_VERSION}"
  implementation "androidx.constraintlayout:constraintlayout:${ANDROIDX_CONSTRAINT_LAYOUT_VERSION}"

  implementation "com.google.android.gms:play-services-location:${PLAY_SERVICES_LOCATION_VERSION}"
  implementation "com.google.android.gms:play-services-maps:${PLAY_SERVICES_MAPS_VERSION}"

  implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}"

  implementation "com.google.firebase:firebase-core:${FIREBASE_CORE_VERSION}"
  implementation "com.google.firebase:firebase-messaging:${FIREBASE_PUSH_MESSAGING_VERSION}"
  implementation "com.google.android.gms:play-services-mlkit-barcode-scanning:${GOOGLE_ML_VISION_BARCODE}"
  implementation "com.google.firebase:firebase-crashlytics:${FIREBASE_CRASHLYTICS_VERSION}"

  implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}"
  implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${KOTLIN_COROUTINES_VERSION}")
  implementation "androidx.lifecycle:lifecycle-runtime-ktx:${KOTLIN_LIFECYCLE_RUNTIME_KTX_VERSION}"
  implementation "androidx.multidex:multidex:${ANDROIDX_MULTIDEX_VERSION}"
}

android {
  compileSdkVersion rootProject.ext.compileSdkVersion
  buildToolsVersion rootProject.ext.buildToolsVersion

  defaultConfig {
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    applicationId "com.appboy.sample"
    versionName rootProject.ext.appVersionName
    versionCode 1
    resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")

    buildConfigField "String", "BUILD_TIME", "\"" + new Date() + "\""
    buildConfigField "boolean", "IS_DROIDBOY_RELEASE_BUILD", "false"
    buildConfigField "String", "SDK_AUTH_ENDPOINT", "\"\""
    buildConfigField "boolean", "STRICTMODE_ENABLED", "false"

    multiDexEnabled true
  }

  lintOptions {
    disable 'MissingTranslation'
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  kotlinOptions {
    freeCompilerArgs = ['-Xjvm-default=all']
    jvmTarget = "1.8"
  }
}
