apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-kapt'

apply plugin: 'kotlin-android-extensions'



android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "dev.ch8n.gittrends"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        buildConfigField("String", "BASE_URL", "\"github-trending-api.now.sh\"")
        buildConfigField("String", "PROTOCOL_HTTP", "\"https://\"")
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    //design
    implementation 'com.google.android.material:material:1.1.0-alpha10'

    def lifecycle_version = "2.1.0"
    // ViewModel and LiveData
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    implementation "com.github.hadilq.liveevent:liveevent:1.0.1"

    implementation 'com.squareup.retrofit2:retrofit:2.6.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'


    //image loading
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'jp.wasabeef:picasso-transformations:2.2.1'

    //dagger - core
    implementation 'com.google.dagger:dagger:2.24'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    kapt "com.google.dagger:dagger-compiler:2.24"
    //dagger - android
    implementation 'com.google.dagger:dagger-android:2.24'
    implementation 'com.google.dagger:dagger-android-support:2.24'
    kapt "com.google.dagger:dagger-android-processor:2.24"


    def room_version = "2.1.0"
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
    //Kotlin Extensions and Coroutines support for Room
    implementation "androidx.room:room-ktx:$room_version"

    //coroutines
    def coroutinesVersion = '1.2.1'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"


    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.0.3'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //robolectric setup with espresso
    testImplementation "android.arch.core:core-testing:1.1.1"
    testImplementation 'androidx.test:core:1.2.0'
    testImplementation 'androidx.test:core-ktx:1.2.0'
    testImplementation 'androidx.test:rules:1.2.0'
    testImplementation 'org.robolectric:robolectric:4.3'
    testImplementation "androidx.test:runner:1.2.0"
    testImplementation "androidx.test.ext:junit:1.1.1"
    testImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
    testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    testImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
    testImplementation 'androidx.test.ext:truth:1.2.0'
    testImplementation 'com.google.truth:truth:0.42'

    //testing coroutines
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
    testImplementation 'com.jraska.livedata:testing-ktx:1.1.0'

    //mockServer
    testImplementation 'com.squareup.okhttp3:mockwebserver:4.1.1'
    testImplementation "io.mockk:mockk:1.9"

    testImplementation 'com.squareup.okhttp3:mockwebserver:4.1.1'

}
