apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlinx-serialization'
android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    buildFeatures{
        dataBinding = true
        viewBinding = true
    }

    defaultConfig {
        applicationId "com.gowtham.letschat"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        buildConfigField("String","SERVER_KEY",SERVER_KEY)
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

    sourceSets {
        main {
            assets.srcDirs = ['src/main/assets', 'src/main/assets/']
            res.srcDirs = ['src/main/res', 'src/main/res/drawable']
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

}

dependencies {
    def work_version = "2.5.0"

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.11'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    // Activity KTX for viewModels()
    implementation "androidx.activity:activity-ktx:1.2.3"

    //Databinding compiler
    kapt "com.android.databinding:compiler:3.1.4"

    //dagger-hilt
    implementation "com.google.dagger:hilt-android:2.36" //don't upgrade unless same version of kapt availale
    kapt "com.google.dagger:hilt-android-compiler:2.36"
    implementation 'androidx.hilt:hilt-work:1.0.0'
    kapt "androidx.hilt:hilt-compiler:1.0.0"

    //event bus
    implementation 'org.greenrobot:eventbus:3.2.0'

    implementation "androidx.recyclerview:recyclerview:1.2.1"

    //mvvm
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

    //Android Navigation Architecture
    implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
    implementation "androidx.navigation:navigation-ui-ktx:2.3.5"

    // Room
    implementation "androidx.room:room-runtime:2.4.0-alpha03"
    kapt "androidx.room:room-compiler:2.4.0-alpha03"

    // Kotlin Extensions and Coroutines support for Room
    implementation "androidx.room:room-ktx:2.4.0-alpha03"

    //For device to device notification sending
    implementation 'com.github.a914-gowtham:fcm-sender:1.0.2'

    //Lottie
    implementation 'com.airbnb.android:lottie:3.7.0'

    //firebase
    //By using the Firebase Android BoM, your app will always use compatible versions of the Firebase Android libraries.
    implementation platform('com.google.firebase:firebase-bom:26.0.0')
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-auth-ktx'
    implementation 'com.google.firebase:firebase-firestore-ktx'
    implementation 'androidx.browser:browser:1.3.0'  //
    implementation 'com.google.firebase:firebase-storage-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-database-ktx'

    implementation 'com.jakewharton.timber:timber:4.7.1'

    //Image loader
    implementation("io.coil-kt:coil:1.2.1")
    implementation("io.coil-kt:coil-gif:1.0.0")
    implementation 'com.github.CanHub:Android-Image-Cropper:3.3.5'

    //image zoom
    implementation 'com.github.stfalcon-studio:StfalconImageViewer:v1.0.1'

    //Kotlin seriler
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1")
     // Work Manager
    implementation "androidx.work:work-runtime-ktx:$work_version"
    implementation "androidx.datastore:datastore-preferences:1.0.0-beta01"


    // Local Unit Tests
    implementation "androidx.test:core:1.3.0"
    testImplementation "junit:junit:4.13.2"
    testImplementation "org.hamcrest:hamcrest-all:1.3"
    testImplementation "androidx.arch.core:core-testing:2.1.0"
    testImplementation "org.robolectric:robolectric:4.3.1"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.1"
    testImplementation "com.google.truth:truth:1.0.1"
    testImplementation "org.mockito:mockito-core:2.21.0"

    // Instrumented Unit Tests
    androidTestImplementation "junit:junit:4.13.2"
    androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.1"
    androidTestImplementation "androidx.arch.core:core-testing:2.1.0"
    androidTestImplementation "com.google.truth:truth:1.0.1"
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    androidTestImplementation "org.mockito:mockito-core:2.28.2"
    androidTestImplementation 'com.google.dagger:hilt-android-testing:2.35'
    kaptAndroidTest 'com.google.dagger:hilt-android-compiler:2.36'
}