Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / gradle.properties
gradle.properties55 lines · 2.7 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> + --max-workers=32 when — and only |
| 7 | # when — the `all` keyword is expanded (a separate big daemon; the small one |
| 8 | # stays alive). Do not raise the default here — override locally in |
| 9 | # ~/.gradle/gradle.properties instead (same mechanism CI uses). |
| 10 | # |
| 11 | # MaxMetaspaceSize=1024m: the previous 512m cap was killing the daemon on |
| 12 | # release builds (R8 fullMode + lintVitalRelease + KSP + Kotlin compile all |
| 13 | # load class metadata into the same daemon's metaspace; with parallel workers we |
| 14 | # easily blew past 512m). |
| 15 | org.gradle.jvmargs=-Xmx8g -Xms512m -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC -Dfile.encoding=UTF-8 |
| 16 | kotlin.daemon.jvm.options=-Xmx1536m |
| 17 | |
| 18 | # Cap parallel workers so concurrent D8/Kotlin workers fit in the default heap. |
| 19 | # ./install raises this for full builds. |
| 20 | org.gradle.workers.max=2 |
| 21 | org.gradle.parallel=true |
| 22 | org.gradle.caching=true |
| 23 | |
| 24 | # Modern defaults |
| 25 | kotlin.code.style=official |
| 26 | |
| 27 | # Performance & Optimization |
| 28 | org.gradle.configuration-cache=true |
| 29 | android.enableR8.fullMode=true |
| 30 | # One thread per R8 task (each runs in its own process, see settings.gradle.kts): |
| 31 | # multi-threaded R8 output depends on thread timing, which broke F-Droid's |
| 32 | # byte-for-byte reproducibility. Release builds parallelize across apps instead |
| 33 | # (android.r8.maxWorkers below). |
| 34 | android.r8.threadPoolSize=1 |
| 35 | # Concurrent per-app R8 processes. Each is a single deterministic thread with a |
| 36 | # 3g heap cap (settings.gradle.kts deterministicR8 profile), so 48 workers use |
| 37 | # at most ~144g and ~48 cores while every APK stays byte-identical anywhere. |
| 38 | android.r8.maxWorkers=48 |
| 39 | |
| 40 | # Preview Support (Remove once SDK 37 is stable) |
| 41 | android.suppressUnsupportedCompileSdk=37.0 |
| 42 | |
| 43 | # Compose Preview Screenshot Testing, used by common-conventions-preview-metadata to render |
| 44 | # store listing images from @Preview instead of from an instrumented test on a device. |
| 45 | # It has to live here rather than in the android {} block: the plugin reads it when it is |
| 46 | # applied, which is before any DSL has been configured. Modules that don't apply the plugin |
| 47 | # just get an empty screenshotTest source set, which costs nothing. |
| 48 | android.experimental.enableScreenshotTest=true |
| 49 | |
| 50 | # Preview rendering is host-side and holds whole bitmaps in memory; the listing images are |
| 51 | # full-screen at xxhdpi (~1080x2340), so the default test-JVM heap is not enough. |
| 52 | android.compose.screenshot.maxHeapSize=4g |
| 53 | |
| 54 | # Enabled parallel sync for Gradle 9.4+ |
| 55 | org.gradle.tooling.parallel=true |