plugins {
    alias(libs.plugins.android.library)
    alias(libs.plugins.kotlin.android)

    alias(libs.plugins.kotlin.kapt)
    alias(libs.plugins.hilt)
}

android {
    namespace = "ru.fincode.tsudesk.feature.news"
    compileSdk = libs.versions.compileSdk.get().toInt()

    defaultConfig {
        minSdk = libs.versions.minSdk.get().toInt()
        consumerProguardFiles("consumer-rules.pro")
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
            )
        }
    }

    val jvm = JavaVersion.toVersion(libs.versions.jvmTarget.get())
    compileOptions {
        sourceCompatibility = jvm
        targetCompatibility = jvm
    }
    kotlinOptions {
        jvmTarget = jvm.toString()
    }
    buildFeatures {
        buildConfig = true
        compose = true
    }
}
kapt {
    correctErrorTypes = true
}
dependencies {
    // Android
    implementation(libs.androidx.appcompat)
    implementation(libs.google.material)
    implementation(libs.kotlinx.collections.immutable)
    implementation(libs.androidx.paging.runtime)

    // Paging
    implementation(libs.androidx.paging.runtime)
    implementation(libs.androidx.paging.compose)

    // Compose
    implementation(platform(libs.androidx.compose.bom))
    implementation(libs.compose.runtime)
    implementation(libs.compose.ui)
    implementation(libs.compose.foundation)
    implementation(libs.compose.material3)

    // Coil
    implementation(libs.coil.compose)

    // Navigation Compose
    implementation(libs.androidx.navigation.compose)

    // Hilt
    kapt(libs.hilt.compiler)
    implementation(libs.hilt.android)
    implementation(libs.androidx.hilt.navigation.compose)

    implementation(projects.core.network)
    implementation(projects.core.config)
    implementation(projects.core.ui)
    implementation(projects.core.navigation)
    implementation(libs.jsoup)
}