// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '8.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
    id 'com.android.library' version '8.1.2' apply false
}

// 统一依赖版本管理
ext {
    // AndroidX 版本 (使用最新稳定版本)
    coreKtxVersion = '1.12.0'
    appCompatVersion = '1.7.1'
    materialVersion = '1.12.0'
    constraintLayoutVersion = '2.1.4'
    recyclerviewVersion = '1.2.1'
    coroutinesVersion = '1.4.1'

    // bugly 版本
    buglyReportVersion = '4.1.9.3'

    // 测试依赖版本
    junitVersion = '4.13.2'
    androidJunitVersion = '1.3.0'
    espressoVersion = '3.7.0'
}

// 为所有子项目提供统一的依赖配置
subprojects {
    ext.deps = [
            // AndroidX 依赖
            coreKtx: "androidx.core:core-ktx:$rootProject.ext.coreKtxVersion",
            appCompat: "androidx.appcompat:appcompat:$rootProject.ext.appCompatVersion",
            material: "com.google.android.material:material:$rootProject.ext.materialVersion",
            constraintLayout: "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintLayoutVersion",
            recyclerview: "androidx.recyclerview:recyclerview:$rootProject.ext.recyclerviewVersion",
            coroutines: "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.ext.coroutinesVersion",

            // bugly 依赖
            buglyReport: "om.tencent.bugly:crashreport:$rootProject.ext.buglyReportVersion",

            // 测试依赖
            junit: "junit:junit:$rootProject.ext.junitVersion",
            androidJunit: "androidx.test.ext:junit:$rootProject.ext.androidJunitVersion",
            espresso: "androidx.test.espresso:espresso-core:$rootProject.ext.espressoVersion"
    ]
}

