apply plugin: 'com.android.application'

android {
    compileSdkVersion 32
    defaultConfig {
        applicationId "com.example.abhishek.newsapp"
        minSdkVersion 22
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        vectorDrawables.useSupportLibrary = true
    }
    signingConfigs {
        release {
            storeFile file("key.jks")
            storePassword "store-pass"
            keyAlias "key0"
            keyPassword "key-pass"
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField("String", "NewsApiKey", NewsApi_ApiKey)
        }
        debug {
            buildConfigField("String", "NewsApiKey", NewsApi_ApiKey)
        }
    }
    dataBinding {
        enabled = true
    }
}

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

    // Support Libraries
    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    // ConstraintLayout
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    // Retrofit for networking
    implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
    implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"

    // Room for persisting data in database
    implementation 'androidx.room:room-runtime:2.4.2'
    annotationProcessor 'androidx.room:room-compiler:2.4.2'

    // ViewModel and LiveData
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

    //Timber for logging
    implementation "com.jakewharton.timber:timber:$timber_version"

    // Image Loading and Caching
    implementation "com.github.bumptech.glide:glide:$glide_version"
    annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"

    implementation "com.google.android.gms:play-services-ads:$ads_sdk_version"
    implementation "com.google.firebase:firebase-core:$firebase_version"

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
