plugins {
    id 'com.android.application'
    id 'com.chaquo.python'
}

android {
    namespace 'com.meshchatx'
    compileSdk 34

    defaultConfig {
        applicationId "com.meshchatx"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "3.1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters "arm64-v8a", "x86_64"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions {
        jniLibs {
            useLegacyPackaging = true
        }
    }
}

chaquopy {
    defaultConfig {
        version = "3.11"
        buildPython "/usr/bin/python3.11"
        
        pip {
            install "aiohttp==3.10.10"
            install "psutil>=7.1.3"
            install "websockets>=15.0.1"
            install "bcrypt==3.1.7"
            install "aiohttp-session>=2.12.1,<3.0.0"
            install "cryptography==42.0.8"
            install "requests>=2.32.5,<3.0.0"
            install "numpy==1.26.2"
            install "ply>=3.11,<4.0"
            install "pycodec2-3.0.1-cp311-cp311-linux_aarch64.whl"
        }
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.10.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.webkit:webkit:1.8.0'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
    
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

