plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id 'RustJNIPlugin'
}

android {
    namespace 'net.xzos.upgradeall.getter'
    compileSdk 36
    ndkVersion "26.3.11579264"

    defaultConfig {
        minSdk 21

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    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 = JavaVersion.VERSION_1_8
    }
}


rustJNI {
    module = "./src/main/rust/api_proxy"
    targets = ["arm64-v8a", "armeabi-v7a", "x86_64", "x86"]
    profile = gradle.startParameter.taskNames.any{it.toLowerCase().contains("debug")} ? "debug" : "release"
    libname = "api_proxy"
}

dependencies {
    implementation "androidx.core:core-ktx:$android_ktx_version"
    implementation 'androidx.appcompat:appcompat:1.7.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'

    implementation project(':core-getter:rpc')
    // Rust TLS - temporarily disabled due to missing artifact
    // implementation "rustls:rustls-platform-verifier:latest.release"
}

