plugins {
    id 'com.android.library'
}

ext {
    VersionNumberString = "$System.env.NumberVersion"
    if (VersionNumberString?.trim() || VersionNumberString.equalsIgnoreCase("null")) {
        VersionNumberString = "0.0.0.1"
    }
}

android {
    compileSdkVersion 32

    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 32

        versionCode 1
        versionName VersionNumberString

        externalNativeBuild {
            cmake {
                cppFlags "-std=c++11 -fexceptions"
                arguments "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang"
            }
        }
    }

    buildTypes {
        debug {
            debuggable true
            jniDebuggable = true
        }
        release {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    externalNativeBuild {
        cmake {
            version "3.18.1"
            path file('CMakeLists.txt')
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}