summaryrefslogtreecommitdiff
path: root/app/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'app/build.gradle.kts')
-rw-r--r--app/build.gradle.kts15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index bc8c4bd..36d6038 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -65,7 +65,20 @@ android {
ndk {
// CPython ships as native code, so every ABI included multiplies the APK size.
// arm64 is the phone; x86_64 is the emulator.
- abiFilters += listOf("arm64-v8a", "x86_64")
+ //
+ // `-PphoneOnly` drops the emulator's copy: measured at 114MB -> 99MB, so 15MB and
+ // not the halving it looks like it should be. The APK is dominated by 72MB of
+ // unminified debug dex, with Chaquopy's assets and one ABI's CPython adding ~25MB
+ // between them; shrinking it meaningfully means R8 on a debug build, not ABIs.
+ //
+ // Not the default: a build with no flag has to stay installable on the emulator too,
+ // or it stops being usable by whoever forgets. Pass it for a build only the phone
+ // will ever install.
+ abiFilters += if (project.hasProperty("phoneOnly")) {
+ listOf("arm64-v8a")
+ } else {
+ listOf("arm64-v8a", "x86_64")
+ }
}
}