apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'kotlin-parcelize'

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.crazylegend.subhub"
        minSdkVersion 24
        targetSdkVersion 30
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {

        debug {
            minifyEnabled false
            crunchPngs false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }

        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
    }

    kapt {
        correctErrorTypes = true
        useBuildCache = true
    }

    buildFeatures {
        viewBinding = true
    }
}

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

    //tests
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'


    //util
    implementation 'com.github.albfernandez:juniversalchardet:2.4.0'
    implementation "androidx.documentfile:documentfile:1.0.1"


    //core
    implementation 'androidx.preference:preference-ktx:1.1.1'
    implementation 'androidx.activity:activity-ktx:1.3.0-alpha06'
    implementation 'androidx.fragment:fragment-ktx:1.3.2'
    implementation 'androidx.core:core-ktx:1.6.0-alpha01'
    implementation 'androidx.appcompat:appcompat:1.2.0'

    //rxjava
    implementation "io.reactivex.rxjava3:rxkotlin:3.0.0"
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'


    //android apis
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

    //live data
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle"
    implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle"
    kapt "androidx.lifecycle:lifecycle-common-java8:$lifecycle"

    //nav
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

    //dagger
    implementation "com.google.dagger:dagger:$daggerVersion"
    kapt "com.google.dagger:dagger-compiler:$daggerVersion"

    //hilt
    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

    //hilt jetpack
    implementation "androidx.hilt:hilt-work:$hiltJetpackVersion"
    kapt "androidx.hilt:hilt-compiler:$hiltJetpackVersion"

    //converters
    implementation 'com.google.code.gson:gson:2.8.6'

    //coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'

    //my
    implementation "com.github.FunkyMuse.KAHelpers:kotlinextensions:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:viewbinding:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:recyclerview:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:gson:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:rx:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:coroutines:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:customviews:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:retrofit:$utilsVersion"
    implementation "com.github.FunkyMuse.KAHelpers:glide:$utilsVersion"
    implementation 'com.github.FunkyMuse.Open-subtitles:opensubshiltsealed:1.0.1'


}
