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

Modern-Apps.git / games / arrows / build.gradle.kts

build.gradle.kts42 lines · 1.6 KiBRaw
1plugins {
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:arrows:metadata` task name either way.
5 id("common-conventions-preview-metadata")
6}
7
8launcherIcon {
9 symbol = "double_arrow"
10}
11
12android {
13 defaultConfig {
14 applicationId = "com.vayunmathur.games.arrows"
15 }
16}
17
18dependencies {
19 implementation(project(":library:work"))
20 implementation(libs.androidx.datastore.preferences)
21}
22
23// Per-class JVM isolation for unit tests, overriding the shared
24// non-Rust batching (forkEvery = 20 in build-logic's RustNative.kt).
25// Proven pollution, not a precaution: every class here drives the
26// process-wide "settings" preferences DataStore, and classes are
27// batched into one JVM per Gradle fork. ArrowsViewModelTest passes
28// alone on taskset -c 0-4 and passes batched with its DataStore /
29// Pages / Achievements neighbours, but in the full module batch a
30// neighbour's leftover store state and actors leave its board won
31// or its next-level load starved (CI run 200d0e1f, and reproduced
32// locally under the same taskset shape). The ViewModel test classes
33// already clear every ViewModel they create; what they cannot clear
34// is another class's actors in the shared sandbox. One JVM per class
35// makes the store each class sees its own. (Registered in
36// afterEvaluate so it runs after the convention plugin's own
37// afterEvaluate batching and wins.)
38afterEvaluate {
39 tasks.withType<org.gradle.api.tasks.testing.Test>().configureEach {
40 forkEvery = 1
41 }
42}