Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / games / nonogram / build.gradle.kts
build.gradle.kts50 lines · 2.1 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-app") |
| 3 | // Listing screenshots come from Compose previews (src/screenshotTest), not from an |
| 4 | // instrumented test on a device. Same `:games:nonogram:metadata` task name either way. |
| 5 | id("common-conventions-preview-metadata") |
| 6 | } |
| 7 | |
| 8 | launcherIcon { |
| 9 | symbol = "grid_view" |
| 10 | } |
| 11 | |
| 12 | android { |
| 13 | defaultConfig { |
| 14 | applicationId = "com.vayunmathur.games.nonogram" |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // One JVM per test class, overriding the non-Rust batching |
| 19 | // (forkEvery = 20) the convention applies to this module: every suite |
| 20 | // here shares the process-wide NonogramDataStore file, and a leaked |
| 21 | // NonogramViewModel keeps collecting it — in a shared JVM its |
| 22 | // regeneration work queues ahead of the next class's load and, under |
| 23 | // CI CPU contention, the whole fork (and with it the task's 45-minute |
| 24 | // budget) wedges behind one class. 13 classes is cheap to fork per |
| 25 | // class; the batched classes were never the throughput problem. |
| 26 | // Registered in afterEvaluate (and so after the convention plugin's |
| 27 | // own afterEvaluate, whose configureEach otherwise overwrites this at |
| 28 | // task realization — verified: without the deferral the task ran |
| 29 | // forkEvery = 20, maxParallelForks = 3). maxHeapSize from the |
| 30 | // convention's wiring stays. |
| 31 | afterEvaluate { |
| 32 | tasks.withType<org.gradle.api.tasks.testing.Test>().configureEach { |
| 33 | forkEvery = 1 |
| 34 | // Serial class JVMs on purpose: the convention's |
| 35 | // (cores / 2) fork count puts 2-3 Robolectric JVMs on a low-core CI |
| 36 | // box at once, and the generator-heavy ViewModel suite's load race |
| 37 | // (a fresh board's generation cancelled/suspended behind the other |
| 38 | // forks' work) flips under that contention — its task then burns |
| 39 | // the whole 45-minute CI budget while every worker sits idle. One |
| 40 | // fork at a time gives the running JVM the whole box; 13 small |
| 41 | // classes still finish in a few minutes. |
| 42 | maxParallelForks = 1 |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | dependencies { |
| 47 | implementation(project(":sdk:games")) |
| 48 | implementation(project(":library:work")) |
| 49 | implementation(libs.androidx.datastore.preferences) |
| 50 | } |