plugins { id("com.android.application") } // build-apk.sh places the Rust cdylib in src/main/jniLibs before Gradle runs. def benchBuild = System.getenv("AI_APP_BENCH") == "1" android { namespace = "dev.iris.android.demo" compileSdk = 37 defaultConfig { applicationId = "com.example.aiapp" // 29, not 26: `iris::android::view`'s touch handler dates each // sample with `MotionEvent.getEventTimeNanos` and // `getHistoricalEventTimeNanos`, both API 29, and a missing JNI // method there is a hard crash on the first touch rather than a // degraded fling. Raised deliberately rather than guarded at // runtime: nothing this app is built for runs below 29, and an // untested fallback path is its own defect. `build-apk.sh`'s // `cargo ndk -P` is kept at the same number. minSdk = 29 // targetSdk 35+ supplies real IME overlap under enforced edge-to-edge. targetSdk = 37 versionCode = 1 versionName = "1.0" manifestPlaceholders = [appLabel: benchBuild ? "AI Sessions bench" : "AI Sessions"] } // The signing key is machine-local; build-apk.sh creates and supplies it. def keystore = System.getenv("AI_APP_KEYSTORE") signingConfigs { if (keystore != null) { release { storeFile = file(keystore) storePassword = System.getenv("AI_APP_KEYSTORE_PASSWORD") keyAlias = "ai-app" keyPassword = storePassword } } } buildTypes { debug { if (benchBuild) { applicationIdSuffix ".bench" } } release { if (benchBuild) { applicationIdSuffix ".bench" } if (keystore != null) { signingConfig = signingConfigs.release } } } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } }