apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

ext.android_support_version = '26.1.0'
ext.arch_version = '1.0.0-alpha9-1'
ext.retrofit_version = '2.3.0'
ext.rxjava_version = '2.1.2'
ext.rxandroid_version = '2.0.1'
ext.butterknife_version = '8.8.1'
ext.picasso_version = '2.5.2'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.abhinav.newsapp"
        minSdkVersion 24
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'String', 'API_KEY', newsAPIKey
        }
        debug {
            buildConfigField 'String', 'API_KEY', newsAPIKey
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

//    kotlin
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    compile "com.android.support:cardview-v7:$android_support_version"
    compile "com.android.support:design:$android_support_version"

    // Architecture Components
    compile "android.arch.lifecycle:runtime:$arch_version"
    compile "android.arch.lifecycle:extensions:$arch_version"
    compile "android.arch.persistence.room:runtime:$arch_version"
    kapt "android.arch.lifecycle:compiler:$arch_version"
    kapt "android.arch.persistence.room:compiler:$arch_version"
    implementation "android.arch.lifecycle:runtime:$arch_version"
    implementation "android.arch.lifecycle:extensions:$arch_version"
    implementation "android.arch.lifecycle:common-java8:1.0.0-beta1"
    implementation "android.arch.lifecycle:reactivestreams:$arch_version"
    implementation "android.arch.persistence.room:runtime:$arch_version"
    implementation "android.arch.persistence.room:rxjava2:$arch_version"
    implementation "android.arch.paging:runtime:1.0.0-alpha2"
    annotationProcessor "android.arch.persistence.room:compiler:$arch_version"
    annotationProcessor "android.arch.lifecycle:compiler:$arch_version"

    // rxJava
    compile "io.reactivex.rxjava2:rxjava:$rxjava_version"
    compile "io.reactivex.rxjava2:rxandroid:$rxandroid_version"

    // Retrofit
    compile "com.squareup.retrofit2:retrofit:$retrofit_version"
    compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    compile 'com.google.code.gson:gson:2.8.0'

    // Support Libraries
    compile "com.android.support:appcompat-v7:$android_support_version"
    compile "com.android.support:recyclerview-v7:$android_support_version"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    // Picasso
    compile "com.squareup.picasso:picasso:$picasso_version"
}
