SFML/examples/android/app/build.gradle.kts
Bruno Van de Velde 4d65844978 Modernized android example
- Replaced ndk-build with CMake
- Updated Groovy DSL (.gradle files) to Kotlin DSL (.gradle.kts files)
- Updated Android Gradle plugin from 3.0 to 7.4
- Config file now targets a more recent Android SDK (and NDK)
- Remove deprecated settings from AndroidManifest
2023-11-14 16:04:30 -07:00

48 lines
1.5 KiB
Plaintext

val NDK_VERSION by extra(project.properties["NDK_VERSION"] as? String ?: "26.1.10909125")
val ARCH_ABI by extra(project.properties["ARCH_ABI"] as? String ?: "arm64-v8a")
val MIN_SDK by extra((project.properties["MIN_SDK"] as? String ?: "21").toInt())
val TARGET_SDK by extra((project.properties["TARGET_SDK"] as? String ?: "33").toInt())
val STL_TYPE by extra(project.properties["STL_TYPE"] as? String ?: "c++_shared")
val SFML_STATIC by extra(project.properties["SFML_STATIC"] as? String ?: "FALSE")
plugins {
id("com.android.application")
}
android {
namespace = "org.sfmldev.android"
ndkVersion = NDK_VERSION
compileSdk = TARGET_SDK
defaultConfig {
applicationId = "org.sfmldev.android"
minSdk = MIN_SDK
targetSdk = TARGET_SDK
versionCode = 1
versionName = "1.0"
ndk {
abiFilters.add(ARCH_ABI)
}
externalNativeBuild {
cmake {
arguments.add("-DANDROID_STL=${STL_TYPE}")
arguments.add("-DSFML_STATIC_LIBRARIES=${SFML_STATIC}")
}
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
externalNativeBuild {
cmake {
path("src/main/jni/CMakeLists.txt")
}
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}