Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / games / solitaire / build.gradle.kts
build.gradle.kts51 lines · 2.2 KiBRaw
| 1 | import org.gradle.testing.jacoco.plugins.JacocoTaskExtension |
| 2 | |
| 3 | plugins { |
| 4 | id("common-conventions-app") |
| 5 | // Listing screenshots come from Compose previews (src/screenshotTest), not from an |
| 6 | // instrumented test on a device. Same `:games:solitaire:metadata` task name either way. |
| 7 | id("common-conventions-preview-metadata") |
| 8 | } |
| 9 | |
| 10 | launcherIcon { |
| 11 | symbol = "playing_cards" |
| 12 | } |
| 13 | |
| 14 | android { |
| 15 | defaultConfig { |
| 16 | applicationId = "com.vayunmathur.games.solitaire" |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | dependencies { |
| 21 | implementation(project(":sdk:games")) |
| 22 | } |
| 23 | |
| 24 | // Offline generator for src/main/assets/solvable_deals.bin (AGENTS.md, "Solvable deals"). |
| 25 | // Inert unless -PsolitaireSeedGen=<output dir> is given; then the unit-test JVM gets the |
| 26 | // generator's settings and a heap big enough for one solver per thread. |
| 27 | val solitaireSeedGen = providers.gradleProperty("solitaireSeedGen") |
| 28 | val solitaireSeedGenTarget = providers.gradleProperty("solitaireSeedGenTarget") |
| 29 | val solitaireSeedGenThreads = providers.gradleProperty("solitaireSeedGenThreads") |
| 30 | val solitaireSeedGenGroups = providers.gradleProperty("solitaireSeedGenGroups") |
| 31 | val solitaireSeedGenHeap = providers.gradleProperty("solitaireSeedGenHeap") |
| 32 | tasks.withType<Test>().configureEach { |
| 33 | if (solitaireSeedGen.isPresent) { |
| 34 | systemProperty("solitaire.seedgen.out", solitaireSeedGen.get()) |
| 35 | systemProperty("solitaire.seedgen.target", solitaireSeedGenTarget.getOrElse("10000")) |
| 36 | systemProperty("solitaire.seedgen.threads", solitaireSeedGenThreads.getOrElse("0")) |
| 37 | systemProperty("solitaire.seedgen.groups", solitaireSeedGenGroups.getOrElse("")) |
| 38 | maxHeapSize = solitaireSeedGenHeap.getOrElse("40g") |
| 39 | // -ea and coverage probes (below) in the solvers' hot loops, shared across |
| 40 | // threads, slow the run by an order of magnitude; neither means anything here. |
| 41 | enableAssertions = false |
| 42 | outputs.upToDateWhen { false } |
| 43 | testLogging.showStandardStreams = true |
| 44 | } |
| 45 | } |
| 46 | // Registered once the coverage plugin is in, so this runs after it adds its task extension. |
| 47 | plugins.withId("jacoco") { |
| 48 | tasks.withType<Test>().configureEach { |
| 49 | if (solitaireSeedGen.isPresent) extensions.getByType(JacocoTaskExtension::class.java).isEnabled = false |
| 50 | } |
| 51 | } |