apply plugin: 'com.android.library'

version = [name: '2.7.1', code: 626]

android {
    namespace 'com.adguard.dnslibs'
    ndkVersion '28.1.13356709'
    compileSdk 34

    defaultConfig {
        minSdk 24

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

        externalNativeBuild {
            cmake {
                targets "adguard-dns"
                arguments "-DANDROID_STL=c++_static",
                        "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
            }
        }
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }

    packagingOptions{
        doNotStrip "*/arm64-v8a/*.so"
        doNotStrip "*/armeabi-v7a/*.so"
        doNotStrip "*/x86/*.so"
        doNotStrip "*/x86_64/*.so"
    }
}

dependencies {
    implementation libs.slf4j.api
    implementation libs.annotations

    testImplementation libs.junit
    androidTestImplementation libs.ext.junit
    androidTestImplementation libs.espresso.core
    androidTestImplementation libs.dnsjava
    androidTestImplementation libs.rules
}
