Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / email / build.gradle.kts
build.gradle.kts69 lines · 2.5 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-app") |
| 3 | id("common-conventions-preview-metadata") |
| 4 | } |
| 5 | |
| 6 | launcherIcon { |
| 7 | symbol = "mail" |
| 8 | } |
| 9 | |
| 10 | android { |
| 11 | namespace = "com.vayunmathur.email" |
| 12 | defaultConfig { |
| 13 | applicationId = "com.vayunmathur.email" |
| 14 | |
| 15 | // Outlook OAuth — own Azure public client (PKCE, no secret) |
| 16 | val outlookClientId = (project.findProperty("EMAIL_OUTLOOK_CLIENT_ID") |
| 17 | ?: "4ee55fe9-12c1-4392-82e6-6c7a2a7954c8").toString() |
| 18 | |
| 19 | buildConfigField("String", "OUTLOOK_OAUTH_CLIENT_ID", "\"$outlookClientId\"") |
| 20 | buildConfigField("String", "OAUTH_REDIRECT_URI", "\"com.vayunmathur.email://oauth\"") |
| 21 | buildConfigField("String", "OUTLOOK_REDIRECT_URI", "\"com.vayunmathur.email://oauth\"") |
| 22 | } |
| 23 | |
| 24 | buildFeatures { |
| 25 | buildConfig = true |
| 26 | } |
| 27 | |
| 28 | testOptions { |
| 29 | // With 40+ Robolectric/Compose classes in one JVM the test worker |
| 30 | // dies mid-suite (Gradle reports only EOFException) as sandboxes and |
| 31 | // socket-server threads accumulate. Fork per class, like the Rust |
| 32 | // modules, so each sandbox starts clean. |
| 33 | unitTests.all { |
| 34 | it.maxHeapSize = "2g" |
| 35 | it.forkEvery = 1 |
| 36 | // forkEvery = 1 alone would run those per-class JVMs one at a |
| 37 | // time (Gradle's default maxParallelForks = 1). Run several |
| 38 | // class-forks concurrently instead, with the same |
| 39 | // memory-bounded formula as build-logic's RustNative wiring: |
| 40 | // each Robolectric fork costs roughly 1-2 GB, so the cap is |
| 41 | // half the processors, clamped to 1..6. |
| 42 | it.maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceIn(1, 6) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | packaging { |
| 47 | resources { |
| 48 | excludes += "/META-INF/{AL2.0,LGPL2.1}" |
| 49 | excludes += "META-INF/NOTICE.md" |
| 50 | excludes += "META-INF/LICENSE.md" |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | dependencies { |
| 56 | implementation(libs.androidx.browser) |
| 57 | implementation(libs.kotlinx.serialization.json) |
| 58 | implementRoom(libs) |
| 59 | implementation(project(":library:room")) |
| 60 | implementation(libs.androidx.work.runtime.ktx) |
| 61 | implementation(libs.androidx.glance) |
| 62 | implementation(libs.androidx.glance.appwidget) |
| 63 | implementation(libs.androidx.glance.material3) |
| 64 | implementation(project(":library:widgets")) |
| 65 | implementation(project(":library:network")) |
| 66 | testImplementation(libs.androidx.work.testing) |
| 67 | testImplementation(libs.androidx.glance.testing) |
| 68 | testImplementation(libs.androidx.glance.appwidget.testing) |
| 69 | } |