plugins {
    alias(libVersions.plugins.android.library)
}

android {
    namespace 'org.eduvpn.common'
    compileSdk 33
    ndkVersion = "26.1.10909125"

    def commonVersion = "2.0.0"

    defaultConfig {
        minSdk 21

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }

        buildConfigField "String", "COMMON_VERSION", "\"$commonVersion\""
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "libs/CMakeLists.txt"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        configureEach {
            externalNativeBuild {
                cmake {
                    targets("libeduvpn_common", "eduvpn_common-wrapper")
                    arguments("-DCOMMON_VERSION=$commonVersion")
                }
            }
        }
    }
}

dependencies {
    implementation 'androidx.annotation:annotation-jvm:1.7.0'
}
