import com.android.build.gradle.internal.api.BaseVariantOutputImpl

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.kotlin.compose)
    alias(libs.plugins.kotlin.serialization)
}

android {
    namespace = "com.iscs.bozzys"
    compileSdk {
        version = release(36)
    }

    defaultConfig {
        applicationId = "com.iscs.bozzys"
        minSdk = 24
        targetSdk = 36
        versionCode = 1
        versionName = "0.0.20260227_1"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        create("release") {
            storeFile = file("./store.jks")
            storePassword = "bozzys2025"
            keyAlias = "bozzys"
            keyPassword = "bozzys2025"
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
            signingConfig = signingConfigs.getByName("release")
        }
        getByName("debug") {
            signingConfig = signingConfigs.getByName("release")
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
    buildFeatures {
        compose = true
    }
    // 构建App包
    applicationVariants.all {
        outputs.all {
            val versionName = versionName
            val buildType = buildType.name
            (this as BaseVariantOutputImpl).outputFileName = "bozzys_${buildType}_$versionName.apk"
        }
    }
}

dependencies {
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.lifecycle.runtime.ktx)
    implementation(libs.androidx.lifecycle.viewmodel.compose)
    implementation(libs.androidx.activity.compose)
    implementation(platform(libs.androidx.compose.bom))
    implementation(libs.androidx.compose.ui)
    implementation(libs.androidx.compose.ui.graphics)
    implementation(libs.androidx.compose.ui.tooling.preview)
    implementation(libs.androidx.compose.material3)
    implementation(libs.androidx.compose.navigation)
    // 指纹组件
    implementation(libs.androidx.biometric)

    // 携程相关包的导入
    implementation(libs.coroutines.core)
    implementation(libs.coroutines.android)
    // 网络请求相关
    implementation(libs.retrofit.core)
    implementation(libs.retrofit.converter.gson)
    implementation(libs.retrofit.interceptor.logging)
    // 轻量级键值对数据存储
    implementation(libs.tencent.mmkv)
    // 阿里云消息推送
    implementation(libs.push)
    implementation(libs.push.third)
    implementation(libs.push.third.xiaomi)
    // 三方库
    implementation(libs.third.json)
    // 日期和时间选择器 下面第二行的依赖是为了引入Dialog
    implementation(libs.third.date.picker)
    implementation("com.google.android.material:material:1.13.0")
    // 图片加载
    implementation(libs.third.image.load)

    implementation(libs.androidx.ui)
    implementation(libs.androidx.ui.graphics)

    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    androidTestImplementation(platform(libs.androidx.compose.bom))
    androidTestImplementation(libs.androidx.compose.ui.test.junit4)
    debugImplementation(libs.androidx.compose.ui.tooling)
    debugImplementation(libs.androidx.compose.ui.test.manifest)
}