apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

ext {
    koin_version = "2.0.0-alpha-3"
}

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.anthony.deepl.openl"
        minSdkVersion 14
        targetSdkVersion 28
        versionCode 6
        versionName "2.1.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    flavorDimensions "mode", "service"
    productFlavors {
        withPlayServices {
            dimension "service"
        }
        withoutPlayServices {
            dimension "service"
        }
        deepl {
            dimension "mode"
        }
        openl {
            dimension "mode"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // Kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'

    // Google & Android libraries
    implementation "androidx.appcompat:appcompat:1.1.0-alpha01"
    implementation "com.google.android.material:material:1.1.0-alpha02"
    implementation "androidx.cardview:cardview:1.0.0"
    implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha2"
    withPlayServicesImplementation('com.crashlytics.sdk.android:crashlytics:2.9.7@aar') {
        transitive = true
    }
    withPlayServicesImplementation 'com.google.firebase:firebase-core:16.0.6'
    withPlayServicesImplementation 'com.google.firebase:firebase-config:16.1.2'

    // Other libraries
    implementation "com.squareup.retrofit2:retrofit:2.5.0"
    implementation "com.squareup.retrofit2:converter-moshi:2.4.0"
    implementation 'com.jakewharton.timber:timber:4.7.1'

    // Koin
    implementation "org.koin:koin-android:$koin_version"
    implementation "org.koin:koin-androidx-viewmodel:$koin_version"

    // ViewModel and LiveData
    implementation "androidx.lifecycle:lifecycle-extensions:2.1.0-alpha01"
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.1.0-alpha01"
    testImplementation "androidx.arch.core:core-testing:2.0.0"

    // Tests
    testImplementation "junit:junit:4.12"
    testImplementation "org.koin:koin-test:$koin_version"
    androidTestImplementation "androidx.test:runner:1.1.1"
    androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"
    androidTestImplementation "org.koin:koin-test:$koin_version"
}

apply plugin: 'com.google.gms.google-services'