plugins {
    id 'com.android.application'
}

android {
    namespace 'com.agui.chatapp.java'
    compileSdk 36

    defaultConfig {
        applicationId 'com.agui.chatapp.java'
        minSdk 26
        targetSdk 36
        versionCode 1
        versionName '1.0'

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }
    
    testOptions {
        animationsDisabled = true
        managedDevices {
            devices {
                pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice) {
                    device = "Pixel 2"
                    apiLevel = 30
                    systemImageSource = "aosp"
                }
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    
    buildFeatures {
        viewBinding true
    }
}

dependencies {
    // KMP Libraries (unchanged)
    implementation 'com.agui:kotlin-client:0.2.1'
    implementation 'com.agui:kotlin-core:0.2.1' 
    implementation 'com.agui:kotlin-tools:0.2.1'
    
    // Kotlin-Java interop bridges
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.10.2'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.10.2'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
    
    // RxJava for Flow interop
    implementation 'io.reactivex.rxjava3:rxjava:3.1.8'
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
    
    // Android Architecture Components
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.activity:activity:1.9.2'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.8.6'
    implementation 'androidx.lifecycle:lifecycle-livedata:2.8.6'
    implementation 'androidx.lifecycle:lifecycle-common-java8:2.8.6'
    implementation 'androidx.recyclerview:recyclerview:1.3.2'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.preference:preference:1.2.1'
    
    // Material Design 3
    implementation 'com.google.android.material:material:1.12.0'
    
    // JSON handling 
    implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1'
    
    // Logging - using library's logback-android implementation
    
    // Testing
    testImplementation 'junit:junit:4.13.2'
    testImplementation 'org.mockito:mockito-core:5.8.0'
    testImplementation 'org.robolectric:robolectric:4.11.1'
    testImplementation 'androidx.test:core:1.6.1'
    testImplementation 'androidx.arch.core:core-testing:2.2.0'
    
    androidTestImplementation 'androidx.test.ext:junit:1.2.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.6.1'
    androidTestImplementation 'androidx.test:runner:1.6.2'
    androidTestImplementation 'androidx.test:rules:1.6.1'
    androidTestImplementation 'androidx.test.ext:truth:1.6.0'
}