Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / ui / build.gradle.kts
build.gradle.kts54 lines · 2.8 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-library") |
| 3 | } |
| 4 | |
| 5 | // Icons codegen: the IconXxx() wrappers are generated at build time from the |
| 6 | // checked-in manifest icons.tsv (see GenerateIconsTask in build-logic), so no |
| 7 | // hand-written wrapper source exists. The generated dir lands under build/, |
| 8 | // which keeps it out of the structure line ratchet, ktlint (its filter already |
| 9 | // excludes **/generated/**) and lint's src/** scans. Hand-written icon code is |
| 10 | // only Icons.kt (AppIcon + the IconNavigation back buttons) and |
| 11 | // IconsCustom.kt (the local ImageVectors the manifest references as vector:). |
| 12 | extensions.configure<com.android.build.api.variant.LibraryAndroidComponentsExtension> { |
| 13 | onVariants { variant -> |
| 14 | val generateIcons = tasks.register( |
| 15 | "generate${variant.name.replaceFirstChar { it.uppercase() }}Icons", |
| 16 | GenerateIconsTask::class.java, |
| 17 | ) { |
| 18 | manifest.set(layout.projectDirectory.file("icons.tsv")) |
| 19 | } |
| 20 | variant.sources.kotlin?.addGeneratedSourceDirectory( |
| 21 | generateIcons, |
| 22 | GenerateIconsTask::outputDir, |
| 23 | ) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | dependencies { |
| 28 | implementation(project(":library")) |
| 29 | |
| 30 | // Expose Material 3 to consumers via `api` so the same-named wrappers/aliases in this |
| 31 | // module compile in app code. Apps depend only on `:library:ui` and must not import |
| 32 | // `androidx.compose.material*` directly (enforced by convention + repo grep check). |
| 33 | api(libs.androidx.compose.material3) |
| 34 | // MaFragmentActivity extends FragmentActivity, so the fragment classes must resolve |
| 35 | // on every app's compile classpath. R8 strips them from APKs whose app never touches |
| 36 | // a fragment (only passwords/photos keep them, and they already ship fragment anyway). |
| 37 | api(libs.androidx.fragment.ktx) |
| 38 | // MaActivity/MaFragmentActivity install the Android 12+ splash (see library |
| 39 | // Theme.General for its icon/background). Apps never name this type, but the |
| 40 | // splash view is created against the activity, so it ships as implementation. |
| 41 | implementation(libs.androidx.core.splashscreen) |
| 42 | // NavigationSuiteScaffold / currentWindowAdaptiveInfo used (via the facade) by openassistant. |
| 43 | api(libs.androidx.compose.material3.adaptive.navigation.suite) |
| 44 | // V2 adaptive info (currentWindowAdaptiveInfoV2) used by the facade in MaterialFunctions.kt. |
| 45 | // implementation (not api): app modules must use the facade, not name adaptive types directly. |
| 46 | implementation(libs.androidx.compose.adaptive.navigation3) |
| 47 | // Used only internally (editor toolbars); not re-exported to apps. |
| 48 | implementation(libs.androidx.compose.material.icons.extended) |
| 49 | // Health Connect client for the consolidated permission gate's async grant probe. |
| 50 | implementation(libs.androidx.connect.client) |
| 51 | // XmlPull impl for JVM unit tests (LatexExporter's MathML parser; same as :office). |
| 52 | testImplementation(libs.kxml2) |
| 53 | |
| 54 | } |