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.schedule"
    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
    }
    composeOptions {
        kotlinCompilerExtensionVersion = libs.versions.kotlinCompilerExtension.get()
    }
}

kapt { correctErrorTypes = true }

dependencies {
    // Kotlin
    implementation(libs.kotlinx.collections.immutable)

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

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

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

    // Core modules
    implementation(projects.core.common)
    implementation(projects.core.config)
    implementation(projects.core.ui)
    implementation(projects.core.navigation)

    implementation(projects.core.network)
    implementation(projects.core.database.api)
}