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.core.network"
    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
    }
}
kapt {
    correctErrorTypes = true
}
dependencies {
    kapt(libs.hilt.compiler)
    implementation(libs.hilt.android)

    api(libs.retrofit)
    api(libs.okhttp)

    implementation(libs.okhttp.logging)
    implementation(libs.retrofit.gson)

    api(libs.moshi)
    api(libs.moshi.kotlin)
    api(libs.retrofit.moshi)

    implementation(projects.core.common)
}