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

android {
    namespace 'com.example.chatapp'
    compileSdk 35

    defaultConfig {
        applicationId "com.example.chatapp"
        minSdk 32
        targetSdk 35
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

configurations {
    all*.exclude group: 'org.jetbrains', module: 'annotations-java5'
}
configurations {
    all*.exclude group: 'org.jetbrains', module: 'annotations-java5'
}

dependencies {
    // Network
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'  // 更新到最新版本

    // Lifecycle & Coroutines
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'  // 更新到最新版本
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'  // 更新到最新版本

    // Markwon
    def markwon_version = "4.6.2"
    implementation "io.noties.markwon:core:$markwon_version"
    implementation "io.noties.markwon:html:$markwon_version"
    implementation "io.noties.markwon:ext-tables:$markwon_version"
    implementation "io.noties.markwon:ext-strikethrough:$markwon_version"
    implementation "io.noties.markwon:syntax-highlight:$markwon_version"
    implementation "io.noties.markwon:image:$markwon_version"

    // AndroidX & Testing
    implementation libs.androidx.core.ktx
    implementation libs.androidx.appcompat
    implementation libs.material
    implementation libs.androidx.activity
    implementation libs.androidx.constraintlayout
    testImplementation libs.junit
    androidTestImplementation libs.androidx.junit
    androidTestImplementation libs.androidx.espresso.core
}