plugins { id "com.android.application" } // The game's assets are staged under a folder named crassets, because Gradle copies the *contents* // of an assets srcDir into the APK's assets/ root. SDL resolves a relative path against that root, // so SDL_LoadFile("crassets/shaders/x.vert") needs assets/crassets/... in the package — staging one // level up is what produces that nesting without renaming anything at the call sites. // Signing lives beside the keystore, outside the repository — this one is public. def signingFile = file("C:/workspace/cromakga3d-secret/keystore/cr3d.properties") def signingProps = new Properties() if (signingFile.exists()) { signingFile.withInputStream { signingProps.load(it) } } def crassetsStage = layout.buildDirectory.dir("crassets-stage") tasks.register("stageCrassets", Sync) { from rootProject.file("../crassets") into crassetsStage.map { it.dir("crassets") } } android { namespace = "com.visai.cromakga3d" compileSdk = 37 ndkVersion = "27.3.13750724" // must match what __build_sdk.py built the static libs with buildToolsVersion = "36.0.0" defaultConfig { // matches SDL_SetAppMetadata in src/main.cpp; permanent once published applicationId = "com.visai.cromakga3d" minSdk = 24 // the static libs were built against android-24 targetSdk = 37 versionCode = 1 versionName = "0.0.1" ndk { // armeabi-v7a is absent by decision: AArch32 flushes denormals to zero, which puts it // outside the determinism contract abiFilters += ["arm64-v8a", "x86_64"] } externalNativeBuild { cmake { arguments "-DANDROID_STL=c++_static" } } } signingConfigs { release { if (signingProps.containsKey("CROMAKGA_STORE_FILE")) { storeFile = file(signingProps["CROMAKGA_STORE_FILE"]) } storePassword = signingProps["CROMAKGA_STORE_PASSWORD"] keyAlias = signingProps["CROMAKGA_KEY_ALIAS"] keyPassword = signingProps["CROMAKGA_KEY_PASSWORD"] } } // find_package(SDL3 CONFIG) in CMakeLists.txt resolves through this buildFeatures { prefab = true } externalNativeBuild { cmake { path = file("../../CMakeLists.txt") version = "3.22.1+" } } sourceSets { main { assets.srcDirs += crassetsStage } } buildTypes { release { minifyEnabled = false signingConfig = signingConfigs.release ndk { // ships a symbol file inside the .aab so Play can symbolicate native crashes debugSymbolLevel = "FULL" } } } lint { abortOnError = false } } tasks.named("preBuild") { dependsOn "stageCrassets" } dependencies { implementation ":SDL3-3.4.14@aar" implementation ":SDL3_ttf-3.2.2@aar" }