plugins {
	id 'com.android.application'
}

android {
    compileSdk 32
	ndkVersion "26.1.10909125"

    externalNativeBuild {
        cmake {
            version "3.22.1"
            path "%CMAKE%"
        }
    }

	defaultConfig {
		applicationId "org.anki.%TARGET%"
		minSdk 30
		targetSdk 32
		versionCode 1
		versionName "1.0"

        externalNativeBuild {
            cmake {
                targets "%TARGET%", "AnKiShaders"
            }
	    }
    }

    buildTypes {
        debug {
            externalNativeBuild {
                cmake {
                    abiFilters.addAll("arm64-v8a")
                    arguments "-DANDROID_TOOLCHAIN=clang",
                            "-DANDROID_STL=c++_static",
                            "-DCMAKE_BUILD_TYPE=Debug",
                            "-DANKI_EXTRA_CHECKS=ON",
                            "-DANKI_BUILD_TESTS=ON",
                            "-DPYTHON_EXECUTABLE:FILEPATH=%PYTHON%",
                            "-DANKI_OVERRIDE_SHADER_COMPILER:FILEPATH=%COMPILER%"
                }
            }

            debuggable true
            jniDebuggable true
        }

        release {
            externalNativeBuild {
                cmake {
                    abiFilters.addAll("arm64-v8a")
                    arguments "-DANDROID_TOOLCHAIN=clang",
                            "-DANDROID_STL=c++_static",
                            "-DCMAKE_BUILD_TYPE=Release",
                            "-DANKI_EXTRA_CHECKS=OFF",
                            "-DANKI_BUILD_TESTS=ON",
                            "-DPYTHON_EXECUTABLE:FILEPATH=%PYTHON%",
                            "-DANKI_OVERRIDE_SHADER_COMPILER:FILEPATH=%COMPILER%"
                }
            }

			// To enable profiling (CPU & memory) disable the following 2 lines:
            debuggable true
            jniDebuggable true

            minifyEnabled false
            signingConfig debug.signingConfig
        }
    }

    sourceSets {
        main {
            assets.srcDirs = ["../assets"]
        }
    }
}

dependencies {
	implementation 'androidx.appcompat:appcompat:1.3.0'
	implementation 'com.google.android.material:material:1.4.0'
	implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}
