apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'de.mannodermaus.android-junit5'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "app.coinverse"
        minSdkVersion 24
        targetSdkVersion 29
        versionCode 64
        versionName "0.64"
        kotlinOptions { jvmTarget = '1.8' }
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    sourceSets { androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) }
    buildTypes {
        release {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro',
                    'proguard.cfg'
        }
        debug {
            applicationIdSuffix ".staging"
            debuggable true
        }
        open {
            initWith debug
            applicationIdSuffix ".open"
        }
    }
    compileOptions { targetCompatibility JavaVersion.VERSION_1_8 }

    buildFeatures.viewBinding = true

    testOptions { unitTests.includeAndroidResources = true }

    task prepareKotlinBuildScriptModel {}
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.google.dagger:dagger:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"
    implementation "com.squareup.inject:assisted-inject-annotations-dagger2:$dagger_assistedinject_version"
    kapt "com.squareup.inject:assisted-inject-processor-dagger2:$dagger_assistedinject_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
    // Use with Firebase
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlin_coroutines_play_services_version"
    implementation "androidx.fragment:fragment-ktx:$fragment_version"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
    implementation "androidx.room:room-ktx:$room_version"
    implementation "androidx.paging:paging-runtime-ktx:$paging_runtime_version"
    implementation "com.google.android.gms:play-services-auth:$play_services_auth_version"
    implementation "com.google.android.gms:play-services-location:$play_services_version"
    implementation "com.firebase:firebase-client-android:$firebase_client_android_version"
    implementation "com.google.firebase:firebase-analytics:$firebase_analytics_version"
    implementation "com.google.firebase:firebase-crashlytics:$firebase_crashlytics_version"
    implementation "com.google.firebase:firebase-perf:$firebase_perf_version"
    implementation "com.google.firebase:firebase-firestore-ktx:$firebase_ktx_version"
    implementation "com.google.firebase:firebase-functions:$firebase_functions_version"
    implementation "com.google.firebase:firebase-auth:$firebase_auth_version"
    implementation "com.firebaseui:firebase-ui-firestore:$firebase_ui_firestore_version"
    implementation "com.firebaseui:firebase-ui-auth:$firebase_ui_auth_version"
    implementation "com.google.firebase:firebase-storage:$firebase_storage_version"
    implementation "com.google.firebase:firebase-inappmessaging-display:$firebase_inappmessaging_version"
    implementation "com.google.firebase:firebase-config:$firebase_config_version"
    implementation "com.jjoe64:graphview:$graphview_version"
    implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
    implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
    implementation "com.github.bumptech.glide:glide:$glide_version"
    kapt "com.github.bumptech.glide:compiler:$glide_version"
    implementation("com.mopub:mopub-sdk-native-static:$mopub_version") { transitive = true }
    implementation("com.mopub:mopub-sdk-native-video:$mopub_version") { transitive = true }
    implementation "com.facebook.android:audience-network-sdk:$facebook_audience_network_version"
    implementation "com.mopub.mediation:facebookaudiencenetwork:$mopub_facebook_mediation_version"
    implementation "com.flurry.android:ads:$flurry_version"
    implementation "com.flurry.android:analytics:$flurry_version"
    implementation "com.mopub.mediation:flurry:$mopub_flurry_mediation_version"

    // Test
    // Local Unit
    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
    testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version"
    testImplementation "io.mockk:mockk:$mockk_version"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_test_version"
    testImplementation "org.assertj:assertj-core:$assertj_version"
}