plugins {
    id 'com.android.application'
}

android {
    namespace = "org.player.switchfin"
    compileSdkVersion 34
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
        versionCode 1
        versionName "1.0"
        ndkVersion "26.3.11579264"
        externalNativeBuild {
            cmake {
                arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_shared", "-DCMAKE_WARN_DEPRECATED=FALSE"
                abiFilters 'armeabi-v7a', 'arm64-v8a'
                version = '3.16.0+'
            }
        }
    }
    signingConfigs {
        release {
            storeFile file("borealis.jks")
            storePassword 'qwe123'
            keyAlias 'borealis'
            keyPassword 'qwe123'

            // Optional, specify signing versions used
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'armeabi-v7a', 'arm64-v8a'
            universalApk false
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
    applicationVariants.all { variant ->
        tasks["merge${variant.name.capitalize()}Assets"]
                .dependsOn("externalNativeBuild${variant.name.capitalize()}")
    }
    if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
        sourceSets.main {
            jniLibs.srcDir 'libs'
        }
        externalNativeBuild {
            cmake {
                path 'jni/CMakeLists.txt'
                version = '3.16.0+'
            }
        }
    }
    lint {
        abortOnError = false
    }
}

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