Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / gradle.properties

gradle.properties46 lines · 2.2 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).
15org.gradle.jvmargs=-Xmx8g -Xms512m -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC -Dfile.encoding=UTF-8
16kotlin.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.
20org.gradle.workers.max=2
21org.gradle.parallel=true
22org.gradle.caching=true
23
24# Modern defaults
25kotlin.code.style=official
26
27# Performance & Optimization
28org.gradle.configuration-cache=true
29android.enableR8.fullMode=true
30
31# Preview Support (Remove once SDK 37 is stable)
32android.suppressUnsupportedCompileSdk=37.0
33
34# Compose Preview Screenshot Testing, used by common-conventions-preview-metadata to render
35# store listing images from @Preview instead of from an instrumented test on a device.
36# It has to live here rather than in the android {} block: the plugin reads it when it is
37# applied, which is before any DSL has been configured. Modules that don't apply the plugin
38# just get an empty screenshotTest source set, which costs nothing.
39android.experimental.enableScreenshotTest=true
40
41# Preview rendering is host-side and holds whole bitmaps in memory; the listing images are
42# full-screen at xxhdpi (~1080x2340), so the default test-JVM heap is not enough.
43android.compose.screenshot.maxHeapSize=4g
44
45# Enabled parallel sync for Gradle 9.4+
46org.gradle.tooling.parallel=true