Skip to content

Commit eeaa9e4

Browse files
authored
feat: add components for bolt (#11140)
2 parents 61d9dd7 + 8e1881c commit eeaa9e4

532 files changed

Lines changed: 888 additions & 781 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app-k9mail/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ android {
144144
dependencies {
145145
implementation(projects.appCommon)
146146
implementation(projects.core.ui.compose.common)
147-
implementation(projects.core.ui.compose.theme2)
148147
implementation(projects.core.ui.legacy.theme2.k9mail)
149148
implementation(projects.feature.launcher)
150149
implementation(projects.feature.mail.message.list.api)

app-thunderbird/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ val fullReleaseImplementation by configurations.creating
224224
dependencies {
225225
implementation(projects.appCommon)
226226
implementation(projects.core.ui.compose.common)
227-
implementation(projects.core.ui.compose.theme2)
228227
implementation(projects.core.ui.legacy.theme2.thunderbird)
229228
implementation(projects.feature.launcher)
230229

app-ui-catalog/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Thunderbird UI Catalog
22

3-
Uses [`:core:ui:compose:designsystem`](../core/ui/compose/designsystem/README.md)
3+
Uses [`:components:ui:bolt`](../components/ui/bolt/README.md)
44

55
This is a catalog of all the components in the Thunderbird design system.
66

app-ui-catalog/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ android {
2727

2828
dependencies {
2929
implementation(projects.core.ui.navigation)
30-
31-
implementation(projects.core.ui.compose.designsystem)
3230
implementation(projects.core.ui.legacy.designsystem)
3331

34-
implementation(projects.core.ui.compose.theme2)
32+
implementation(projects.core.ui.contract)
3533

3634
implementation(libs.jetbrains.compose.material3)
3735
implementation(libs.jetbrains.compose.material.icons.extended)

build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ android {
3030
}
3131

3232
dependencies {
33+
val isComponentsBuild = rootProject.name == "components"
3334
val composeBom = platform(libs.androidx.compose.bom)
3435
implementation(composeBom)
3536
androidTestImplementation(composeBom)
@@ -45,4 +46,9 @@ dependencies {
4546
androidTestImplementation(libs.bundles.shared.android.app.compose.androidTest)
4647

4748
implementation(libs.androidx.activity.compose)
49+
50+
if (!isComponentsBuild) {
51+
implementation(libs.tb.mobile.components.ui.bolt)
52+
testImplementation(libs.tb.mobile.components.ui.testing)
53+
}
4854
}

build-plugin/src/main/kotlin/thunderbird.library.android.compose.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ androidComponents {
1818
}
1919

2020
dependencies {
21+
val isComponentsBuild = rootProject.name == "components"
2122
val composeBom = platform(libs.androidx.compose.bom)
2223
implementation(composeBom)
2324
androidTestImplementation(composeBom)
@@ -31,4 +32,9 @@ dependencies {
3132
testImplementation(libs.bundles.shared.android.compose.test)
3233

3334
androidTestImplementation(libs.bundles.shared.android.compose.androidTest)
35+
36+
if (!isComponentsBuild) {
37+
implementation(libs.tb.mobile.components.ui.bolt)
38+
testImplementation(libs.tb.mobile.components.ui.testing)
39+
}
3440
}

build-plugin/src/main/kotlin/thunderbird.library.kmp.compose.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ kotlin {
3636
}
3737

3838
sourceSets {
39+
val isComponentsBuild = rootProject.name == "components"
40+
3941
commonMain.dependencies {
4042
implementation(project.dependencies.platform(libs.kotlin.bom))
4143
implementation(project.dependencies.platform(libs.koin.bom))
@@ -47,11 +49,19 @@ kotlin {
4749
implementation(libs.jetbrains.compose.ui)
4850
implementation(libs.jetbrains.compose.components.resources)
4951
implementation(libs.jetbrains.compose.components.ui.preview)
52+
53+
if (!isComponentsBuild) {
54+
implementation(libs.tb.mobile.components.ui.bolt)
55+
}
5056
}
5157

5258
commonTest.dependencies {
5359
implementation(libs.bundles.shared.kmp.common.test)
5460
implementation(libs.bundles.shared.kmp.compose.common.test)
61+
62+
if (!isComponentsBuild) {
63+
implementation(libs.tb.mobile.components.ui.testing)
64+
}
5565
}
5666

5767
androidMain.dependencies {

components/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Components
2+
3+
This directory contains independently buildable and releasable parts of the project.
4+
5+
A component should have a clear boundary, be testable on its own, and be consumable by the app through a published
6+
artifact, such as a Maven dependency. Local source development can still be supported through Gradle composite builds.
7+
8+
## What belongs here
9+
10+
Use `components/` for code that can reasonably be versioned, built, tested, and released independently.
11+
12+
Examples:
13+
14+
* shared KMP or Android libraries
15+
* sync, storage, network, crypto, or telemetry libraries
16+
* reusable test support libraries
17+
* developer tooling such as code generators or lint rules
18+
19+
## What does not belong here
20+
21+
Do not use `components/` for app-owned feature code or app-internal shared modules.
22+
23+
Use:
24+
25+
* `apps-xyz` for final applications
26+
* `features/` for product features and screens
27+
* `core/` for app-internal shared modules
28+
* `build-logic/` for Gradle convention plugins and build infrastructure
29+
30+
## Rules
31+
32+
Components must not depend on `apps/`, `features/`, or `core/`.
33+
34+
If a component needs code from `core/`, either move that dependency into the component, promote the shared code into
35+
its own component, or introduce a smaller public API.
36+
37+
The app currently consumes local component sources by default through dependency substitution. Disable local source
38+
substitution with the `tb.components.local` Gradle property when testing released artifacts.
39+
40+
```shell
41+
./gradlew -Ptb.components.local=false :app-ui-catalog:assembleDebug
42+
```
43+
44+
Individual component groups can provide their own override property. Bolt substitution can be controlled with
45+
`tb.components.local.bolt`.
46+
47+
Moving code into `components/` is only useful if the app build no longer configures and compiles that component by default.

components/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
alias(libs.plugins.android.library) apply false
3+
alias(libs.plugins.android.multiplatform.library) apply false
4+
alias(libs.plugins.compose) apply false
5+
alias(libs.plugins.jetbrains.compose) apply false
6+
alias(libs.plugins.kotlin.multiplatform) apply false
7+
alias(libs.plugins.kotlin.serialization) apply false
8+
alias(libs.plugins.kover) apply false
9+
}

components/gradle.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Android
2+
android.useAndroidX=true
3+
android.nonTransitiveRClass=true
4+
## Disable buildFeatures flags by default: https://developer.android.com/build/releases/gradle-plugin#default-changes
5+
android.defaults.buildfeatures.resvalues=false
6+
android.defaults.buildfeatures.shaders=false
7+
# Gradle
8+
## Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750
9+
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=512m -XX:InitialCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx8g -XX:+IgnoreUnrecognizedVMOptions -XX:+SuppressCDSWarning
10+
org.gradle.parallel=true
11+
org.gradle.caching=true
12+
org.gradle.configuration-cache=true
13+
org.gradle.configuration-cache.parallel=true
14+
org.gradle.kotlin.dsl.allWarningsAsErrors=true
15+
# Kotlin
16+
kotlin.code.style=official
17+
kotlin.compiler.execution.strategy=in-process
18+
kotlin.daemon.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=512m -XX:InitialCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx8g

0 commit comments

Comments
 (0)