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

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.dnar.dicodingsubmissionbfaa"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

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

    buildFeatures {
        dataBinding = true
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }

    packagingOptions {
        exclude 'META-INF/atomicfu.kotlin_module'
    }

}

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.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    // Dagger2
    def daggerVersion = '2.27'
    implementation "com.google.dagger:dagger:$daggerVersion"
    implementation "com.google.dagger:dagger-android-support:$daggerVersion"
    kapt "com.google.dagger:dagger-compiler:$daggerVersion"
    kapt "com.google.dagger:dagger-android-processor:$daggerVersion"

    // ViewModel
    def lifecycleVersion = '2.2.0'
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"

    // Android Navigation Architecture
    def navigationVersion = '2.2.2'
    implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
    implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"

    // Retrofit2
    def retrofitVersion = '2.9.0'
    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
    implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"

    // OkHttp3
    def okHttpVersion = '4.3.1'
    implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
    implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"

    // RxJava
    def rxJavaVersion = '2.2.19'
    implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"

    // RxKotlin
    def rxKotlinVersion = '2.4.0'
    implementation "io.reactivex.rxjava2:rxkotlin:$rxKotlinVersion"

    // RxAndroid
    def rxAndroidVersion = '2.1.1'
    implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"

    // Room
    def roomVersion = '2.2.5'
    implementation "androidx.room:room-runtime:$roomVersion"
    implementation "androidx.room:room-ktx:$roomVersion"
    implementation "androidx.room:room-rxjava2:$roomVersion"
    kapt "androidx.room:room-compiler:$roomVersion"

    // Preference
    def preferenceVersion = '1.1.1'
    implementation "androidx.preference:preference:$preferenceVersion"

    // Glide
    def glideVersion = '4.11.0'
    implementation "com.github.bumptech.glide:glide:$glideVersion"

    // Sweet Alert
    def sweetAlertVersion = '1.6.2'
    implementation "com.github.f0ris.sweetalert:library:$sweetAlertVersion"

    // Fancy Toast
    def fancyToastVersion = '0.1.6'
    implementation "com.github.Shashank02051997:FancyToast-Android:$fancyToastVersion"

    // Testing
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation "androidx.room:room-testing:$roomVersion"
}