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