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