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

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

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

    defaultConfig {
        applicationId = "ru.fincode.tsudesk"
        minSdk = libs.versions.minSdk.get().toInt()
        targetSdk = libs.versions.targetSdk.get().toInt()
        versionCode = libs.versions.versionCode.get().toInt()
        versionName = libs.versions.versionName.get()
    }

    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 {
    // Compose
    implementation(libs.androidx.activity.compose)
    implementation(platform(libs.androidx.compose.bom))
    implementation(libs.compose.runtime)
    implementation(libs.compose.ui)
    implementation(libs.compose.foundation)
    implementation(libs.compose.material3)
    implementation(libs.compose.material.icons.extended)


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

    // DI: Hilt
    implementation(libs.hilt.android)
    kapt(libs.hilt.compiler)

    // Modules
    implementation(projects.core.common)
    implementation(projects.core.config)
    implementation(projects.core.navigation)
    implementation(projects.core.database.impl)
    implementation(projects.core.ui)

    implementation(projects.feature.splash)
    implementation(projects.feature.schedule)
    implementation(projects.feature.progress)
    implementation(projects.feature.news)

    debugImplementation(libs.compose.ui.tooling)
    debugImplementation(libs.compose.ui.test.manifest)
}