plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.plugin.compose") } android { namespace = "dev.lerch.tally" compileSdk = 35 defaultConfig { applicationId = "dev.lerch.tally" minSdk = 26 targetSdk = 35 versionCode = 1 versionName = "0.1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" // Only the ABIs `zig build android` produces. Anything else would package an // empty folder and fail at load rather than at build. ndk { abiFilters += listOf("arm64-v8a", "x86_64", "armeabi-v7a") } } // The native library comes from `zig build android`, which writes the jniLibs layout // directly. Gradle only packages it: it never invokes Zig, and there is no CMake or // ndk-build here on purpose (design 1). sourceSets { getByName("main") { jniLibs.srcDirs("../../zig-out/android") } } buildFeatures { compose = true } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlin { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) } } buildTypes { release { // Nothing to shrink yet; the engine is native and the Kotlin is one screen. isMinifyEnabled = false } } packaging { // The library is already ReleaseSmall and stripped by Zig. jniLibs.keepDebugSymbols += "**/libtally.so" } } dependencies { val composeBom = platform("androidx.compose:compose-bom:2024.10.01") implementation(composeBom) androidTestImplementation(composeBom) implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.activity:activity-compose:1.9.3") implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7") implementation("androidx.compose.ui:ui") implementation("androidx.compose.material3:material3") // The converter's rules are plain Kotlin and run on the JVM: `gradle testDebugUnitTest`, // no device. Already in the Gradle cache as a dependency of androidx.test.ext:junit. testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test:runner:1.6.2") }