plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
    id 'kotlin-platform-android'
    id 'dagger.hilt.android.plugin'
}


android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion
    defaultConfig {
        applicationId 'com.eltaher.task'
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "com.task.CustomTestRunner"
    }
    buildFeatures {
        viewBinding = true
    }
    buildTypes {
        debug {
            debuggable true
        }
        release {
            debuggable false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    flavorDimensions "default"
    productFlavors {
        dev {
            dimension = 'default'
            applicationIdSuffix = ".dev"
        }
        prod {
            dimension = 'default'
        }
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }
    configurations.all {
        resolutionStrategy {
            exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"

        }
    }
    defaultConfig {
        testInstrumentationRunnerArguments clearPackageData: 'true'
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }
    android {
        sourceSets {
            String sharedTestDir = 'src/sharedTest/resources'
            test {
                resources.srcDirs += sharedTestDir
            }
            androidTest {
                resources.srcDirs += sharedTestDir
            }
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation "androidx.annotation:annotation:$annotationVersion"
    implementation "com.squareup.picasso:picasso:$picassoVersion"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$livedata_ktx"
    androidTestImplementation "androidx.test.ext:junit-ktx:$androidXJunitVersion"
    /**-------------------testing libs------------------------------------------**/
    //UI Testing , AndroidJUnitRunner and JUnit Rules &Espresso dependencies
    //junit 5
    testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
    testImplementation "io.mockk:mockk:$mockVersion"
    androidTestImplementation "org.assertj:assertj-core:$assertjVersion"
    androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoIntentsVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesTestVersion"
    implementation "androidx.arch.core:core-testing:$coreTestingVersion"
    implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
    implementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
    /**-------------------------------------------------------------**/
    //android support
    implementation "androidx.appcompat:appcompat:$appcompatVersion"
    implementation "com.google.android.material:material:$materialVersion"
    // retrofit
    implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"
    implementation "com.squareup.moshi:moshi:$moshiVersion"
    kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
    implementation "com.squareup.okhttp3:logging-interceptor:$okhttpInterceptorVersion"
    implementation("com.github.bumptech.glide:glide:$glid") {
        exclude group: "com.android.support"
    }
    implementation "androidx.activity:activity-ktx:$activityKtxVersion"
    // Hilt
    implementation "com.google.dagger:hilt-android:$hilt_version"
    implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_viewmodels"
    kapt "com.google.dagger:hilt-compiler:$hilt_version"
    androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
    kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hilt_version"
}
kapt {
    correctErrorTypes true
}