# Default daemon heap is sized for scoped work (:module: builds, lint, agents): # small Xms so idle daemons are cheap and several can coexist without the OS # killing them (a kill forces a full multi-minute reconfigure on next build). # Full-repo builds (`./install all`, ~100 modules with concurrent D8 dex merge) # OOM on this heap, so ./install auto-escalates with # -Dorg.gradle.jvmargs=<46g big-build heap> when — and only when — the `all` # keyword is expanded (a separate big daemon; the small one stays alive). # # MaxMetaspaceSize=1024m: the previous 512m cap was killing the daemon on # release builds (R8 fullMode + lintVitalRelease + KSP + Kotlin compile all # load class metadata into the same daemon's metaspace; with parallel workers we # easily blew past 512m). org.gradle.jvmargs=-Xmx8g -Xms512m -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC -Dfile.encoding=UTF-8 # 4g: cold all-builds queue dozens of module compiles through the daemon; # the old 1536m cap made large Compose modules GC-thrash mid-compile. kotlin.daemon.jvm.options=-Xmx4g # Parallel task workers. The build graph is wide (~100 app modules with # independent Kotlin/KSP/dex work), so the default uses the dev box's cores; # scoped builds simply never queue that many tasks. The daemon heap above # stays small — heavy compiler/dex work runs in its own daemons/workers — # and ./install still escalates the heap for `all` builds. org.gradle.workers.max=128 org.gradle.parallel=true org.gradle.caching=true # Modern defaults kotlin.code.style=official # Performance & Optimization org.gradle.configuration-cache=true # Variants (see build-logic common-conventions-app/-library): apps and # libraries define only dev+release build types (debug variants disabled, # dev not debuggable, both initWith(release)); app dev matches library dev # by exact name, and library unit tests are testDevUnitTest. android.enableR8.fullMode=true # One thread per R8 task (each runs in its own process, see settings.gradle.kts): # multi-threaded R8 output depends on thread timing, which broke F-Droid's # byte-for-byte reproducibility. Release builds parallelize across apps instead # (android.r8.maxWorkers below). android.r8.threadPoolSize=1 # Concurrent per-app R8 processes. Each is a single deterministic thread with a # 3g heap cap (settings.gradle.kts deterministicR8 profile), so 48 workers use # at most ~144g and ~48 cores while every APK stays byte-identical anywhere. android.r8.maxWorkers=48 # Preview Support (Remove once SDK 37 is stable) android.suppressUnsupportedCompileSdk=37.0 # Compose Preview Screenshot Testing, used by common-conventions-preview-metadata to render # store listing images from @Preview instead of from an instrumented test on a device. # It has to live here rather than in the android {} block: the plugin reads it when it is # applied, which is before any DSL has been configured. Modules that don't apply the plugin # just get an empty screenshotTest source set, which costs nothing. android.experimental.enableScreenshotTest=true # Preview rendering is host-side and holds whole bitmaps in memory; the listing images are # full-screen at xxhdpi (~1080x2340), so the default test-JVM heap is not enough. android.compose.screenshot.maxHeapSize=4g # Enabled parallel sync for Gradle 9.4+ org.gradle.tooling.parallel=true