diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt index c7cf43f5a..cddcf5fe2 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt @@ -21,16 +21,12 @@ import com.google.samples.apps.nowinandroid.configureGradleManagedDevices import com.google.samples.apps.nowinandroid.configureKotlinAndroid import com.google.samples.apps.nowinandroid.configurePrintApksTask import com.google.samples.apps.nowinandroid.configureSpotlessForAndroid -import com.google.samples.apps.nowinandroid.isIsolatedProjectsEnabled import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.configuration.BuildFeatures import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure -import javax.inject.Inject abstract class AndroidApplicationConventionPlugin : Plugin { - @get:Inject abstract val buildFeatures: BuildFeatures override fun apply(target: Project) { with(target) { apply(plugin = "com.android.application") @@ -47,9 +43,7 @@ abstract class AndroidApplicationConventionPlugin : Plugin { configurePrintApksTask(this) configureBadgingTasks(this) } - if (!buildFeatures.isIsolatedProjectsEnabled()) { - configureSpotlessForAndroid() - } + configureSpotlessForAndroid() } } } diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt index fd58973cc..d5aaa131d 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -22,18 +22,14 @@ import com.google.samples.apps.nowinandroid.configureKotlinAndroid import com.google.samples.apps.nowinandroid.configurePrintApksTask import com.google.samples.apps.nowinandroid.configureSpotlessForAndroid import com.google.samples.apps.nowinandroid.disableUnnecessaryAndroidTests -import com.google.samples.apps.nowinandroid.isIsolatedProjectsEnabled import com.google.samples.apps.nowinandroid.libs import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.configuration.BuildFeatures import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies -import javax.inject.Inject abstract class AndroidLibraryConventionPlugin : Plugin { - @get:Inject abstract val buildFeatures: BuildFeatures override fun apply(target: Project) { with(target) { apply(plugin = "com.android.library") @@ -57,9 +53,7 @@ abstract class AndroidLibraryConventionPlugin : Plugin { configurePrintApksTask(this) disableUnnecessaryAndroidTests(target) } - if (!buildFeatures.isIsolatedProjectsEnabled()) { - configureSpotlessForAndroid() - } + configureSpotlessForAndroid() dependencies { "androidTestImplementation"(libs.findLibrary("kotlin.test").get()) "testImplementation"(libs.findLibrary("kotlin.test").get()) diff --git a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt index 510e84680..9e7633f4d 100644 --- a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt @@ -16,26 +16,20 @@ import com.google.samples.apps.nowinandroid.configureKotlinJvm import com.google.samples.apps.nowinandroid.configureSpotlessForJvm -import com.google.samples.apps.nowinandroid.isIsolatedProjectsEnabled import com.google.samples.apps.nowinandroid.libs import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.configuration.BuildFeatures import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.dependencies -import javax.inject.Inject abstract class JvmLibraryConventionPlugin : Plugin { - @get:Inject abstract val buildFeatures: BuildFeatures override fun apply(target: Project) { with(target) { apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "nowinandroid.android.lint") configureKotlinJvm() - if (!buildFeatures.isIsolatedProjectsEnabled()) { - configureSpotlessForJvm() - } + configureSpotlessForJvm() dependencies { "testImplementation"(libs.findLibrary("kotlin.test").get()) } diff --git a/build-logic/convention/src/main/kotlin/RootPlugin.kt b/build-logic/convention/src/main/kotlin/RootPlugin.kt index 174c7e18b..26c940635 100644 --- a/build-logic/convention/src/main/kotlin/RootPlugin.kt +++ b/build-logic/convention/src/main/kotlin/RootPlugin.kt @@ -16,7 +16,6 @@ import com.google.samples.apps.nowinandroid.configureGraphTasks import com.google.samples.apps.nowinandroid.configureSpotlessForRootProject -import com.google.samples.apps.nowinandroid.isIsolatedProjectsEnabled import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.configuration.BuildFeatures @@ -29,7 +28,11 @@ abstract class RootPlugin : Plugin { require(target.path == ":") if (!buildFeatures.isIsolatedProjectsEnabled()) { target.subprojects { configureGraphTasks() } - target.configureSpotlessForRootProject() } + target.configureSpotlessForRootProject() } } + +private fun BuildFeatures.isIsolatedProjectsEnabled(): Boolean { + return isolatedProjects.active.getOrElse(false) +} diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectIsolation.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectIsolation.kt deleted file mode 100644 index 322af745d..000000000 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectIsolation.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2026 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.samples.apps.nowinandroid - -import org.gradle.api.configuration.BuildFeatures - -fun BuildFeatures.isIsolatedProjectsEnabled(): Boolean { - return isolatedProjects.active.orElse(false).get() -} diff --git a/core/navigation/README.md b/core/navigation/README.md index 7cd3b7e9f..88b78d1ce 100644 --- a/core/navigation/README.md +++ b/core/navigation/README.md @@ -1,3 +1,48 @@ -# :core:navigation module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_navigation.svg) +# `:core:navigation` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:navigation[navigation]:::android-library + end + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
📋 Graph legend + +```mermaid +graph TB + application[application]:::android-application + feature[feature]:::android-feature + library[library]:::android-library + jvm[jvm]:::jvm-library + + application -.-> feature + library --> jvm + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
+ diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt index bb2b59466..f5c1cde99 100644 --- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt +++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt @@ -16,14 +16,16 @@ package com.google.samples.apps.nowinandroid.core.ui +import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview /** * Multipreview annotation that represents various device sizes. Add this annotation to a composable * to render various devices. */ -@Preview(name = "phone", device = "spec:shape=Normal,width=360,height=640,unit=dp,dpi=480") -@Preview(name = "landscape", device = "spec:shape=Normal,width=640,height=360,unit=dp,dpi=480") -@Preview(name = "foldable", device = "spec:shape=Normal,width=673,height=841,unit=dp,dpi=480") -@Preview(name = "tablet", device = "spec:shape=Normal,width=1280,height=800,unit=dp,dpi=480") +@Preview(name = "phone", device = Devices.PHONE, showBackground = true) +@Preview(name = "phone_in_landscape", widthDp = 891, heightDp = 411, showBackground = true) +@Preview(name = "foldable", device = Devices.FOLDABLE, showBackground = true) +@Preview(name = "tablet", device = Devices.TABLET, showBackground = true) +@Preview(name = "desktop", device = Devices.DESKTOP, showBackground = true) annotation class DevicePreviews diff --git a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt b/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt index 65bc4acf2..d10f24d51 100644 --- a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt +++ b/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt @@ -155,7 +155,7 @@ private fun LoadingState(modifier: Modifier = Modifier) { modifier = modifier .fillMaxWidth() .wrapContentSize() - .testTag("forYou:loading"), + .testTag("bookmarks:loading"), contentDesc = stringResource(id = R.string.feature_bookmarks_api_loading), ) } diff --git a/feature/interests/impl/README.md b/feature/interests/impl/README.md index 722f4ef41..4582d4115 100644 --- a/feature/interests/impl/README.md +++ b/feature/interests/impl/README.md @@ -1,3 +1,101 @@ -# :feature:interests:impl module -## Dependency graph -![Dependency graph](../../../docs/images/graphs/dep_graph_feature_interests_impl.svg) +# `:feature:interests:impl` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :feature + direction TB + subgraph :feature:interests + direction TB + :feature:interests:api[api]:::android-library + :feature:interests:impl[impl]:::android-library + end + subgraph :feature:topic + direction TB + :feature:topic:api[api]:::android-library + end + end + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:common[common]:::jvm-library + :core:data[data]:::android-library + :core:database[database]:::android-library + :core:datastore[datastore]:::android-library + :core:datastore-proto[datastore-proto]:::jvm-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:navigation[navigation]:::android-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + + :core:data -.-> :core:analytics + :core:data --> :core:common + :core:data --> :core:database + :core:data --> :core:datastore + :core:data --> :core:network + :core:data -.-> :core:notifications + :core:database --> :core:model + :core:datastore -.-> :core:common + :core:datastore --> :core:datastore-proto + :core:datastore --> :core:model + :core:domain --> :core:data + :core:domain --> :core:model + :core:network --> :core:common + :core:network --> :core:model + :core:notifications -.-> :core:common + :core:notifications --> :core:model + :core:ui --> :core:analytics + :core:ui --> :core:designsystem + :core:ui --> :core:model + :feature:interests:api --> :core:navigation + :feature:interests:impl -.-> :core:designsystem + :feature:interests:impl -.-> :core:domain + :feature:interests:impl -.-> :core:ui + :feature:interests:impl -.-> :feature:interests:api + :feature:interests:impl -.-> :feature:topic:api + :feature:topic:api -.-> :core:designsystem + :feature:topic:api --> :core:navigation + :feature:topic:api -.-> :core:ui + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
📋 Graph legend + +```mermaid +graph TB + application[application]:::android-application + feature[feature]:::android-feature + library[library]:::android-library + jvm[jvm]:::jvm-library + + application -.-> feature + library --> jvm + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
+ diff --git a/feature/topic/api/README.md b/feature/topic/api/README.md index 62103d57b..2baa9b879 100644 --- a/feature/topic/api/README.md +++ b/feature/topic/api/README.md @@ -1,3 +1,66 @@ -# :feature:topic:api module -## Dependency graph -![Dependency graph](../../../docs/images/graphs/dep_graph_feature_topic_api.svg) +# `:feature:topic:api` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :feature + direction TB + subgraph :feature:topic + direction TB + :feature:topic:api[api]:::android-library + end + end + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:navigation[navigation]:::android-library + :core:ui[ui]:::android-library + end + + :core:ui --> :core:analytics + :core:ui --> :core:designsystem + :core:ui --> :core:model + :feature:topic:api -.-> :core:designsystem + :feature:topic:api --> :core:navigation + :feature:topic:api -.-> :core:ui + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
📋 Graph legend + +```mermaid +graph TB + application[application]:::android-application + feature[feature]:::android-feature + library[library]:::android-library + jvm[jvm]:::jvm-library + + application -.-> feature + library --> jvm + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
+ diff --git a/feature/topic/impl/README.md b/feature/topic/impl/README.md index eee690ec0..449373f65 100644 --- a/feature/topic/impl/README.md +++ b/feature/topic/impl/README.md @@ -1,3 +1,92 @@ -# :feature:topic:impl module -## Dependency graph -![Dependency graph](../../../docs/images/graphs/dep_graph_feature_topic_impl.svg) +# `:feature:topic:impl` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :feature + direction TB + subgraph :feature:topic + direction TB + :feature:topic:api[api]:::android-library + :feature:topic:impl[impl]:::android-library + end + end + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:common[common]:::jvm-library + :core:data[data]:::android-library + :core:database[database]:::android-library + :core:datastore[datastore]:::android-library + :core:datastore-proto[datastore-proto]:::jvm-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:navigation[navigation]:::android-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + + :core:data -.-> :core:analytics + :core:data --> :core:common + :core:data --> :core:database + :core:data --> :core:datastore + :core:data --> :core:network + :core:data -.-> :core:notifications + :core:database --> :core:model + :core:datastore -.-> :core:common + :core:datastore --> :core:datastore-proto + :core:datastore --> :core:model + :core:network --> :core:common + :core:network --> :core:model + :core:notifications -.-> :core:common + :core:notifications --> :core:model + :core:ui --> :core:analytics + :core:ui --> :core:designsystem + :core:ui --> :core:model + :feature:topic:api -.-> :core:designsystem + :feature:topic:api --> :core:navigation + :feature:topic:api -.-> :core:ui + :feature:topic:impl -.-> :core:data + :feature:topic:impl -.-> :core:designsystem + :feature:topic:impl -.-> :core:ui + :feature:topic:impl -.-> :feature:topic:api + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
📋 Graph legend + +```mermaid +graph TB + application[application]:::android-application + feature[feature]:::android-feature + library[library]:::android-library + jvm[jvm]:::jvm-library + + application -.-> feature + library --> jvm + +classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; +classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; +classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; +classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; +classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; +``` + +
+ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fbe070c1a..16123b7f6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,7 +60,7 @@ retrofitKotlinxSerializationJson = "1.0.0" robolectric = "4.16" roborazzi = "1.56.0" room = "2.8.3" -spotless = "8.2.1" +spotless = "8.3.0" truth = "1.4.4" turbine = "1.2.0" uiTestJunit4 = "1.9.0-rc01" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 61285a659..d997cfc60 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 44ae9537e..92ed94347 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=0d585f69da091fc5b2beced877feab55a3064d43b8a1d46aeb07996b0915e0e0 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip +distributionSha256Sum=60ea723356d81263e8002fec0fcf9e2b0eee0c0850c7a3d7ab0a63f2ccc601f3 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index adff685a0..0262dcbd5 100755 --- a/gradlew +++ b/gradlew @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/.