plugins {
    id 'kotlin-android'
    id 'com.android.library'
}

android {
    namespace "com.konovalov.vad.silero"

    defaultConfig {
        compileSdk 36
        minSdkVersion 24
        targetSdkVersion 36
        versionCode 19
        versionName "2.0.10"

        setProperty("archivesBaseName", "android-vad-silero-v" + versionName)

        ndk {
            abiFilters "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
        }

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

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

    publishing {
        singleVariant("release") {
            withSourcesJar()
            withJavadocJar()
        }
    }

    aaptOptions {
        noCompress "onnx"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlin {
        jvmToolchain(8)
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation(platform('org.jetbrains.kotlin:kotlin-bom:2.2.0'))
    implementation 'com.microsoft.onnxruntime:onnxruntime-android:1.22.0'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test:runner:1.6.2'
    androidTestImplementation 'androidx.test.ext:junit-ktx:1.2.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}