apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'

android {
    compileSdkVersion 31
    ndkVersion = '21.2.6472646'

    defaultConfig {
        applicationId "net.alexbarry.alexgames"
        minSdkVersion 24
        targetSdkVersion 31
        versionCode 3
        versionName "0.0.4"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
            // Specifying external directory for native build files because they get big
            // and I'm running out of room in my cloud storage backup
            // buildStagingDirectory "C:/tmp/android_native_build/alex_games/"
        }
    }


    flavorDimensions 'cpuArch'
    productFlavors {
        arm8 {
            dimension 'cpuArch'
            ndk {
                abiFilters 'arm64-v8a', 'armeabi-v7a'
            }
        }
        x86_64 {
            dimension 'cpuArch'
            ndk {
                abiFilters 'x86_64', 'x86'
            }
        }
        universal {
            dimension 'cpuArch'
            // include all default ABIs. with NDK-r16,  it is:
            //   armeabi-v7a, arm64-v8a, x86, x86_64
        }
    }
    namespace 'net.alexbarry.alexgames'


}

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

    api 'org.nanohttpd:nanohttpd:2.3.1'
    api 'org.nanohttpd:nanohttpd-websocket:2.3.1'

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.navigation:navigation-fragment:2.3.4'
    implementation 'androidx.navigation:navigation-ui:2.3.4'
    implementation 'androidx.webkit:webkit:1.4.0'
    testImplementation 'junit:junit:4.12'
}
