apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "andreabresolin.androidcoroutinesplayground"
        minSdkVersion 28
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        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
    }
}

ext {
    appcompat_version = '1.0.2'
    core_ktx_version = '1.0.1'
    dagger_version = '2.20'
    kotlin_coroutines_version = '1.2.1'
    lifecycle_version = '2.0.0'
    constraintlayout_version = '1.1.3'
    navigation_version = '1.0.0'
    paris_version = '1.2.1'
    timber_version = '4.7.1'
    junit_version = '4.12'
    mockito_version = '2.24.0'
    assertj_version = '3.11.1'
    architecture_core_testing_version = '1.1.0'
    test_runner_version = '1.1.1'
    espresso_core_version = '3.1.1'
}

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

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation "androidx.appcompat:appcompat:$appcompat_version"
    implementation "androidx.core:core-ktx:$core_ktx_version"

    // Dagger
    implementation "com.google.dagger:dagger:$dagger_version"
    implementation "com.google.dagger:dagger-android:$dagger_version"
    implementation "com.google.dagger:dagger-android-support:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"
    kapt "com.google.dagger:dagger-android-processor:$dagger_version"

    // Kotlin coroutines
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_version"

    // Architecture Components: Lifecycle, LiveData, ViewModel
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"

    // ConstraintLayout
    implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"

    // Architecture Components: Navigation
    implementation "android.arch.navigation:navigation-fragment-ktx:$navigation_version"
    implementation "android.arch.navigation:navigation-ui-ktx:$navigation_version"

    // Paris
    implementation "com.airbnb.android:paris:$paris_version"
    kapt "com.airbnb.android:paris-processor:$paris_version"

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

    // JUnit
    testImplementation "junit:junit:$junit_version"

    // Mockito
    testImplementation "org.mockito:mockito-core:$mockito_version"
    testImplementation "org.mockito:mockito-inline:$mockito_version"
    androidTestImplementation "org.mockito:mockito-android:$mockito_version"

    // AssertJ
    testImplementation "org.assertj:assertj-core:$assertj_version"

    // Architecture Components: testing
    testImplementation "android.arch.core:core-testing:$architecture_core_testing_version"

    // Espresso
    androidTestImplementation "androidx.test:runner:$test_runner_version"
    androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core_version"
}
