diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index a4a49b8ee..2a52855b8 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -77,6 +77,28 @@ jobs: disable_globbing: true commit_message: "🤖 Updates baselines for Dependency Guard" + - name: Update Graphs + run: ./gradlew graphUpdate + + - name: Check Graphs + id: graphs_verify + run: git add -- '**/README.md' && git diff --cached --quiet --exit-code -- '**/README.md' + + - name: Prevent updating graphs if this is a fork + id: checkfork_graphs + continue-on-error: false + if: steps.graphs_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository + run: | + echo "::error::Check Graphs failed, please update graphs with: ./gradlew graphUpdate" && exit 1 + + - name: Push new graphs if available + if: steps.graphs_verify.outcome == 'failure' && github.event_name == 'pull_request' + uses: stefanzweifel/git-auto-commit-action@v5 + with: + file_pattern: '**/README.md' + disable_globbing: true + commit_message: "🤖 Updates graphs" + - name: Run all local screenshot tests (Roborazzi) id: screenshotsverify continue-on-error: true diff --git a/app-nia-catalog/README.md b/app-nia-catalog/README.md index cf6d05f4f..1b71784e8 100644 --- a/app-nia-catalog/README.md +++ b/app-nia-catalog/README.md @@ -1,3 +1,36 @@ -# :app-nia-catalog module -## Dependency graph -![Dependency graph](../docs/images/graphs/dep_graph_app_nia_catalog.svg) +# `:app-nia-catalog` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:ui[ui]:::android-library + end + :app-nia-catalog[app-nia-catalog]:::android-application + + :app-nia-catalog -.-> :core:designsystem + :app-nia-catalog -.-> :core:ui + :core:ui ---> :core:analytics + :core:ui ---> :core:designsystem + :core:ui ---> :core:model + +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/app/README.md b/app/README.md index a3fb4572a..0a75a68d0 100644 --- a/app/README.md +++ b/app/README.md @@ -1,3 +1,112 @@ -# :app module -## Dependency graph -![Dependency graph](../docs/images/graphs/dep_graph_app.svg) +# `:app` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:bookmarks[bookmarks]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:search[search]:::android-feature + :feature:settings[settings]:::android-feature + :feature:topic[topic]:::android-feature + end + subgraph :sync + direction TB + :sync:work[work]:::android-library + end + :benchmarks[benchmarks]:::android-test + :app[app]:::android-application + + :app -.->|baselineProfile| :benchmarks + :app -.-> :core:analytics + :app -.-> :core:common + :app -.-> :core:data + :app -.-> :core:designsystem + :app -.-> :core:model + :app -.-> :core:ui + :app -.-> :feature:bookmarks + :app -.-> :feature:foryou + :app -.-> :feature:interests + :app -.-> :feature:search + :app -.-> :feature:settings + :app -.-> :feature:topic + :app -.-> :sync:work + :benchmarks -.->|testedApks| :app + :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:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:foryou -.-> :core:data + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui + :feature:interests -.-> :core:data + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :core:ui + :feature:search -.-> :core:data + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui + :sync:work -.-> :core:analytics + :sync:work -.-> :core:data + :sync:work -.-> :core:notifications + +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/benchmarks/README.md b/benchmarks/README.md new file mode 100644 index 000000000..26f4e4f1a --- /dev/null +++ b/benchmarks/README.md @@ -0,0 +1,112 @@ +# `:benchmarks` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:bookmarks[bookmarks]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:search[search]:::android-feature + :feature:settings[settings]:::android-feature + :feature:topic[topic]:::android-feature + end + subgraph :sync + direction TB + :sync:work[work]:::android-library + end + :benchmarks[benchmarks]:::android-test + :app[app]:::android-application + + :app -.->|baselineProfile| :benchmarks + :app -.-> :core:analytics + :app -.-> :core:common + :app -.-> :core:data + :app -.-> :core:designsystem + :app -.-> :core:model + :app -.-> :core:ui + :app -.-> :feature:bookmarks + :app -.-> :feature:foryou + :app -.-> :feature:interests + :app -.-> :feature:search + :app -.-> :feature:settings + :app -.-> :feature:topic + :app -.-> :sync:work + :benchmarks -.->|testedApks| :app + :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:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:foryou -.-> :core:data + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui + :feature:interests -.-> :core:data + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :core:ui + :feature:search -.-> :core:data + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui + :sync:work -.-> :core:analytics + :sync:work -.-> :core:data + :sync:work -.-> :core:notifications + +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/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 958ae82f5..166b54907 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -114,5 +114,9 @@ gradlePlugin { id = libs.plugins.nowinandroid.jvm.library.get().pluginId implementationClass = "JvmLibraryConventionPlugin" } + register("root") { + id = libs.plugins.nowinandroid.root.get().pluginId + implementationClass = "RootPlugin" + } } } diff --git a/build-logic/convention/src/main/kotlin/RootPlugin.kt b/build-logic/convention/src/main/kotlin/RootPlugin.kt new file mode 100644 index 000000000..b704adf76 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/RootPlugin.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2025 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. + */ + +import com.google.samples.apps.nowinandroid.configureGraphTasks +import org.gradle.api.Plugin +import org.gradle.api.Project + +class RootPlugin : Plugin { + override fun apply(target: Project) { + require(target.path == ":") + target.subprojects { configureGraphTasks() } + } +} diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Graph.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Graph.kt new file mode 100644 index 000000000..85d5b956d --- /dev/null +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Graph.kt @@ -0,0 +1,287 @@ +/* + * Copyright 2025 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 com.android.utils.associateWithNotNull +import com.google.samples.apps.nowinandroid.PluginType.Unknown +import org.gradle.api.DefaultTask +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.ProjectDependency +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.MapProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity.NONE +import org.gradle.api.tasks.TaskAction +import org.gradle.kotlin.dsl.assign +import org.gradle.kotlin.dsl.register +import org.gradle.kotlin.dsl.withType +import kotlin.text.RegexOption.DOT_MATCHES_ALL + +/** + * Generates module dependency graphs with `graphDump` task, and update the corresponding `README.md` file with `graphUpdate`. + * + * This is not an optimal implementation and could be improved if needed: + * - [Graph.invoke] is **recursively** searching through dependent projects (although in practice it will never reach a stack overflow). + * - [Graph.invoke] is entirely re-executed for all projects, without re-using intermediate values. + * - [Graph.invoke] is always executed during Gradle's Configuration phase (but takes in general less than 1 ms for a project). + * + * The resulting graphs can be configured with `graph.ignoredProjects` and `graph.supportedConfigurations` properties. + */ +private class Graph( + private val root: Project, + private val dependencies: MutableMap>> = mutableMapOf(), + private val plugins: MutableMap = mutableMapOf(), + private val seen: MutableSet = mutableSetOf(), +) { + + private val ignoredProjects = root.providers.gradleProperty("graph.ignoredProjects") + .map { it.split(",").toSet() } + .orElse(emptySet()) + private val supportedConfigurations = + root.providers.gradleProperty("graph.supportedConfigurations") + .map { it.split(",").toSet() } + .orElse(setOf("api", "implementation", "baselineProfile", "testedApks")) + + operator fun invoke(project: Project = root): Graph { + if (project.path in seen) return this + seen += project.path + plugins.putIfAbsent( + project, + PluginType.entries.firstOrNull { project.pluginManager.hasPlugin(it.id) } ?: Unknown, + ) + dependencies.compute(project) { _, u -> u.orEmpty() } + project.configurations + .matching { it.name in supportedConfigurations.get() } + .associateWithNotNull { it.dependencies.withType().ifEmpty { null } } + .flatMap { (c, value) -> value.map { dep -> c to project.project(dep.path) } } + .filter { (_, p) -> p.path !in ignoredProjects.get() } + .forEach { (configuration: Configuration, projectDependency: Project) -> + dependencies.compute(project) { _, u -> u.orEmpty() + (configuration to projectDependency) } + invoke(projectDependency) + } + return this + } + + fun dependencies(): Map>> = dependencies + .mapKeys { it.key.path } + .mapValues { it.value.mapTo(mutableSetOf()) { (c, p) -> c.name to p.path } } + + fun plugins() = plugins.mapKeys { it.key.path } +} + +/** + * Declaration order is important, as only the first match will be retained. + */ +internal enum class PluginType(val id: String, val ref: String, val style: String) { + AndroidApplication( + id = "nowinandroid.android.application", + ref = "android-application", + style = "fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000", + ), + AndroidFeature( + id = "nowinandroid.android.feature", + ref = "android-feature", + style = "fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000", + ), + AndroidLibrary( + id = "nowinandroid.android.library", + ref = "android-library", + style = "fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000", + ), + AndroidTest( + id = "nowinandroid.android.test", + ref = "android-test", + style = "fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000", + ), + Jvm( + id = "nowinandroid.jvm.library", + ref = "jvm-library", + style = "fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000", + ), + Unknown( + id = "?", + ref = "unknown", + style = "fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000", + ), +} + +internal fun Project.configureGraphTasks() { + if (!buildFile.exists()) return // Ignore root modules without build file + val dumpTask = tasks.register("graphDump") { + val graph = Graph(this@configureGraphTasks).invoke() + projectPath = this@configureGraphTasks.path + dependencies = graph.dependencies() + plugins = graph.plugins() + output = this@configureGraphTasks.layout.buildDirectory.file("mermaid.txt") + } + tasks.register("graphUpdate") { + projectPath = this@configureGraphTasks.path + input = dumpTask.flatMap { it.output } + output = this@configureGraphTasks.layout.projectDirectory.file("README.md") + } +} + +@CacheableTask +private abstract class GraphDumpTask : DefaultTask() { + + @get:Input + abstract val projectPath: Property + + @get:Input + abstract val dependencies: MapProperty>> + + @get:Input + abstract val plugins: MapProperty + + @get:OutputFile + abstract val output: RegularFileProperty + + override fun getDescription() = "Dumps project dependencies to a mermaid file." + + @TaskAction + operator fun invoke() { + output.get().asFile.writeText(mermaid()) + logger.lifecycle(output.get().asFile.toPath().toUri().toString()) + } + + private fun mermaid() = buildString { + val dependencies: Set = dependencies.get() + .flatMapTo(mutableSetOf()) { (project, entries) -> entries.map { it.toDependency(project) } } + // FrontMatter configuration (not supported yet on GitHub.com) + appendLine( + // language=YAML + """ + --- + config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE + --- + """.trimIndent(), + ) + // Graph declaration + appendLine("graph TB") + // Nodes and subgraphs (limited to a single nested layer) + val (rootProjects, nestedProjects) = dependencies + .map { listOf(it.project, it.dependency) }.flatten().toSet() + .plus(projectPath.get()) // Special case when this specific module has no other dependency + .groupBy { it.substringBeforeLast(":") } + .entries.partition { it.key.isEmpty() } + nestedProjects.sortedByDescending { it.value.size }.forEach { (group, projects) -> + appendLine(" subgraph $group") + appendLine(" direction TB") + projects.sorted().forEach { + appendLine(it.alias(indent = 4, plugins.get().getValue(it))) + } + appendLine(" end") + } + rootProjects.flatMap { it.value }.sortedDescending().forEach { + appendLine(it.alias(indent = 2, plugins.get().getValue(it))) + } + // Links + if (dependencies.isNotEmpty()) appendLine() + dependencies + .sortedWith(compareBy({ it.project }, { it.dependency }, { it.configuration })) + .forEach { appendLine(it.link(indent = 2)) } + // Classes + appendLine() + PluginType.entries.forEach { appendLine(it.classDef()) } + } + + private class Dependency(val project: String, val configuration: String, val dependency: String) + + private fun Pair.toDependency(project: String) = + Dependency(project, configuration = first, dependency = second) + + private fun String.alias(indent: Int, pluginType: PluginType): String = buildString { + append(" ".repeat(indent)) + append(this@alias) + append("[").append(substringAfterLast(":")).append("]:::") + append(pluginType.ref) + } + + private fun Dependency.link(indent: Int) = buildString { + append(" ".repeat(indent)) + append(project).append(" ") + append( + when (configuration) { + "api" -> "--->" + "implementation" -> "-.->" + else -> "-.->|$configuration|" + }, + ) + append(" ").append(dependency) + } + + private fun PluginType.classDef() = "classDef $ref $style;" +} + +@CacheableTask +private abstract class GraphUpdateTask : DefaultTask() { + + @get:Input + abstract val projectPath: Property + + @get:InputFile + @get:PathSensitive(NONE) + abstract val input: RegularFileProperty + + @get:OutputFile + abstract val output: RegularFileProperty + + override fun getDescription() = "Updates Markdown file with the corresponding dependency graph." + + @TaskAction + operator fun invoke() = with(output.get().asFile) { + if (!exists()) { + createNewFile() + writeText( + """ + # `${projectPath.get()}` + + ## Module dependency graph + + + + """.trimIndent(), + ) + } + val regex = """()(.*?)()""".toRegex(DOT_MATCHES_ALL) + val text = readText().replace(regex) { match -> + val (start, _, end) = match.destructured + val mermaid = input.get().asFile.readText().trimTrailingNewLines() + """ + |$start + |```mermaid + |$mermaid + |``` + |$end + """.trimMargin() + } + writeText(text) + } + + private fun String.trimTrailingNewLines() = lines() + .dropLastWhile(String::isBlank) + .joinToString(System.lineSeparator()) +} diff --git a/build.gradle.kts b/build.gradle.kts index 425b2c640..594f7f92e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,5 +38,5 @@ plugins { alias(libs.plugins.roborazzi) apply false alias(libs.plugins.google.osslicenses) apply false alias(libs.plugins.room) apply false - alias(libs.plugins.module.graph) apply true // Plugin applied to allow module graph generation + alias(libs.plugins.nowinandroid.root) } diff --git a/core/analytics/README.md b/core/analytics/README.md index d2bcd1ea7..0441403b1 100644 --- a/core/analytics/README.md +++ b/core/analytics/README.md @@ -1,3 +1,26 @@ -# :core:analytics module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_analytics.svg) +# `:core:analytics` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:analytics[analytics]:::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; +``` + diff --git a/core/common/README.md b/core/common/README.md index 96558bcc6..e385e9b2d 100644 --- a/core/common/README.md +++ b/core/common/README.md @@ -1,3 +1,26 @@ -# :core:common module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_common.svg) +# `:core:common` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:common[common]:::jvm-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; +``` + diff --git a/core/data-test/README.md b/core/data-test/README.md index 977ee10e4..ac7fdce83 100644 --- a/core/data-test/README.md +++ b/core/data-test/README.md @@ -1,3 +1,51 @@ -# :core:data-test module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_data_test.svg) +# `:core:data-test` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:common[common]:::jvm-library + :core:data[data]:::android-library + :core:data-test[data-test]:::android-library + :core:database[database]:::android-library + :core:datastore[datastore]:::android-library + :core:datastore-proto[datastore-proto]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::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:data-test ---> :core:data + :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 + +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/data/README.md b/core/data/README.md index 5d30f1638..57a101df5 100644 --- a/core/data/README.md +++ b/core/data/README.md @@ -1,3 +1,49 @@ -# :core:data module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_data.svg) +# `:core:data` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::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 + +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/database/README.md b/core/database/README.md index 855eab53e..98d5907f5 100644 --- a/core/database/README.md +++ b/core/database/README.md @@ -1,3 +1,29 @@ -# :core:database module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_database.svg) +# `:core:database` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:database[database]:::android-library + :core:model[model]:::jvm-library + end + + :core:database ---> :core:model + +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/datastore-proto/README.md b/core/datastore-proto/README.md index 19ed58239..b3985d45b 100644 --- a/core/datastore-proto/README.md +++ b/core/datastore-proto/README.md @@ -1,3 +1,26 @@ -# :core:datastore-proto module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_proto.svg) +# `:core:datastore-proto` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:datastore-proto[datastore-proto]:::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; +``` + diff --git a/core/datastore-test/README.md b/core/datastore-test/README.md index 99cf13f1f..988172cff 100644 --- a/core/datastore-test/README.md +++ b/core/datastore-test/README.md @@ -1,3 +1,36 @@ -# :core:datastore-test module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_test.svg) +# `:core:datastore-test` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:common[common]:::jvm-library + :core:datastore[datastore]:::android-library + :core:datastore-proto[datastore-proto]:::android-library + :core:datastore-test[datastore-test]:::android-library + :core:model[model]:::jvm-library + end + + :core:datastore -.-> :core:common + :core:datastore ---> :core:datastore-proto + :core:datastore ---> :core:model + :core:datastore-test -.-> :core:common + :core:datastore-test -.-> :core:datastore + +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/datastore/README.md b/core/datastore/README.md index 4785c5885..710567e73 100644 --- a/core/datastore/README.md +++ b/core/datastore/README.md @@ -1,3 +1,33 @@ -# :core:datastore module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore.svg) +# `:core:datastore` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:common[common]:::jvm-library + :core:datastore[datastore]:::android-library + :core:datastore-proto[datastore-proto]:::android-library + :core:model[model]:::jvm-library + end + + :core:datastore -.-> :core:common + :core:datastore ---> :core:datastore-proto + :core:datastore ---> :core:model + +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/designsystem/README.md b/core/designsystem/README.md index d1778cb14..eeedb3093 100644 --- a/core/designsystem/README.md +++ b/core/designsystem/README.md @@ -1,3 +1,26 @@ -# :core:designsystem module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_designsystem.svg) +# `:core:designsystem` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:designsystem[designsystem]:::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; +``` + diff --git a/core/domain/README.md b/core/domain/README.md index cc6905846..c92d4e18d 100644 --- a/core/domain/README.md +++ b/core/domain/README.md @@ -1,3 +1,52 @@ -# :core:domain module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_domain.svg) +# `:core:domain` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::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 + +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/model/README.md b/core/model/README.md index efd0eec76..175ecdd3a 100644 --- a/core/model/README.md +++ b/core/model/README.md @@ -1,3 +1,26 @@ -# :core:model module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_model.svg) +# `:core:model` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:model[model]:::jvm-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; +``` + diff --git a/core/network/README.md b/core/network/README.md index 516aa2d38..3fcd8d9a4 100644 --- a/core/network/README.md +++ b/core/network/README.md @@ -1,3 +1,31 @@ -# :core:network module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_network.svg) +# `:core:network` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:common[common]:::jvm-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + end + + :core:network ---> :core:common + :core:network ---> :core:model + +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/notifications/README.md b/core/notifications/README.md index 8f5607bdf..1c73d0b2b 100644 --- a/core/notifications/README.md +++ b/core/notifications/README.md @@ -1,3 +1,31 @@ -# :core:notifications module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_notifications.svg) +# `:core:notifications` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:common[common]:::jvm-library + :core:model[model]:::jvm-library + :core:notifications[notifications]:::android-library + end + + :core:notifications -.-> :core:common + :core:notifications ---> :core:model + +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/screenshot-testing/README.md b/core/screenshot-testing/README.md index 9bd4f1f9c..d8e942128 100644 --- a/core/screenshot-testing/README.md +++ b/core/screenshot-testing/README.md @@ -1,3 +1,29 @@ -# :core:screenshot-testing module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_screenshot_testing.svg) +# `:core:screenshot-testing` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:designsystem[designsystem]:::android-library + :core:screenshot-testing[screenshot-testing]:::android-library + end + + :core:screenshot-testing -.-> :core:designsystem + +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/testing/README.md b/core/testing/README.md index 5a35d379b..6dd50a19d 100644 --- a/core/testing/README.md +++ b/core/testing/README.md @@ -1,3 +1,55 @@ -# :core:testing module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_testing.svg) +# `:core:testing` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:testing[testing]:::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:testing ---> :core:analytics + :core:testing ---> :core:common + :core:testing ---> :core:data + :core:testing ---> :core:model + :core:testing ---> :core:notifications + +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/README.md b/core/ui/README.md index 38e514d01..f1a48f7c4 100644 --- a/core/ui/README.md +++ b/core/ui/README.md @@ -1,3 +1,33 @@ -# :core:ui module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_ui.svg) +# `:core:ui` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + subgraph :core + direction TB + :core:analytics[analytics]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:ui[ui]:::android-library + end + + :core:ui ---> :core:analytics + :core:ui ---> :core:designsystem + :core:ui ---> :core:model + +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/docs/ModularizationLearningJourney.md b/docs/ModularizationLearningJourney.md index a9766c68d..5cda61b69 100644 --- a/docs/ModularizationLearningJourney.md +++ b/docs/ModularizationLearningJourney.md @@ -85,7 +85,57 @@ how you can organize your project. In general, you should strive for low couplin ## Types of modules in Now in Android -![Diagram showing types of modules and their dependencies in Now in Android](images/modularization-graph.drawio.png "Diagram showing types of modules and their dependencies in Now in Android") +```mermaid +graph TB + subgraph :core + direction TB + :core:data[data]:::android-library + :core:database[database]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:topic[topic]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:foo[...]:::android-feature + + end + :app[app]:::android-application + + :app -.-> :feature:foryou + :app -.-> :feature:interests + :app -.-> :feature:topic + :core:data ---> :core:database + :core:data ---> :core:network + :core:database ---> :core:model + :core:network ---> :core:model + :core:ui ---> :core:model + :feature:topic -.-> :core:data + :feature:topic -.-> :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 jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +``` + +
📋 Graph legend + +```mermaid +graph TB + application:::android-application -. implementation .-> feature:::android-feature + library:::android-library -- api --> jvm:::jvm-library + +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 jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; +``` + +
**Top tip**: A module graph (shown above) can be useful during modularization planning for visualizing dependencies between modules. @@ -233,6 +283,9 @@ Using the above modularization strategy, the Now in Android app has the followin +Each module has its own `README.md` file containing a module graph (e.g. [`:app` module graph](../app/README.md#module-dependency-graph)). +When modules dependencies change, module graphs are automatically updated by the [Build.yaml](../.github/workflows/Build.yaml) workflow. +You can also manually update the graphs by running the `graphUpdate` task. ## Modularization in Now in Android diff --git a/docs/images/graphs/dep_graph_app.svg b/docs/images/graphs/dep_graph_app.svg deleted file mode 100644 index 8e5d9d429..000000000 --- a/docs/images/graphs/dep_graph_app.svg +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - :app - - - - :feature:interests - - - - - - - - :feature:foryou - - - - - - - - :feature:bookmarks - - - - - - - - :feature:topic - - - - - - - - :feature:search - - - - - - - - :feature:settings - - - - - - - - :core:common - - - - - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - :core:model - - - - - - - - :core:analytics - - - - - - - - :sync:work - - - - - - - - - - - - - - - - - - - - :core:domain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_app_nia_catalog.svg b/docs/images/graphs/dep_graph_app_nia_catalog.svg deleted file mode 100644 index 151ee63ad..000000000 --- a/docs/images/graphs/dep_graph_app_nia_catalog.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - :app-nia-catalog - - - - :core:designsystem - - - - - - - - :core:ui - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_analytics.svg b/docs/images/graphs/dep_graph_core_analytics.svg deleted file mode 100644 index 45f1c1eb0..000000000 --- a/docs/images/graphs/dep_graph_core_analytics.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - :core:analytics - - - diff --git a/docs/images/graphs/dep_graph_core_common.svg b/docs/images/graphs/dep_graph_core_common.svg deleted file mode 100644 index 91033eaa0..000000000 --- a/docs/images/graphs/dep_graph_core_common.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - :core:common - - - diff --git a/docs/images/graphs/dep_graph_core_data.svg b/docs/images/graphs/dep_graph_core_data.svg deleted file mode 100644 index ab91bafb2..000000000 --- a/docs/images/graphs/dep_graph_core_data.svg +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - :core:data - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:analytics - - - - - - - - :core:notifications - - - - - - - - :core:model - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_data_test.svg b/docs/images/graphs/dep_graph_core_data_test.svg deleted file mode 100644 index b9736c859..000000000 --- a/docs/images/graphs/dep_graph_core_data_test.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - :core:data-test - - - - :core:data - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:analytics - - - - - - - - :core:notifications - - - - - - - - :core:model - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_database.svg b/docs/images/graphs/dep_graph_core_database.svg deleted file mode 100644 index e82d46436..000000000 --- a/docs/images/graphs/dep_graph_core_database.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - :core:database - - - - :core:model - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_datastore.svg b/docs/images/graphs/dep_graph_core_datastore.svg deleted file mode 100644 index f7502e55b..000000000 --- a/docs/images/graphs/dep_graph_core_datastore.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - :core:datastore - - - - :core:datastore-proto - - - - - - - - :core:model - - - - - - - - :core:common - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_datastore_proto.svg b/docs/images/graphs/dep_graph_core_datastore_proto.svg deleted file mode 100644 index 7fcfb8358..000000000 --- a/docs/images/graphs/dep_graph_core_datastore_proto.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - :core:datastore-proto - - - diff --git a/docs/images/graphs/dep_graph_core_datastore_test.svg b/docs/images/graphs/dep_graph_core_datastore_test.svg deleted file mode 100644 index 37521a05f..000000000 --- a/docs/images/graphs/dep_graph_core_datastore_test.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - :core:datastore-test - - - - :core:common - - - - - - - - :core:datastore - - - - - - - - - - - - :core:datastore-proto - - - - - - - - :core:model - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_designsystem.svg b/docs/images/graphs/dep_graph_core_designsystem.svg deleted file mode 100644 index 737140876..000000000 --- a/docs/images/graphs/dep_graph_core_designsystem.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - :core:designsystem - - - diff --git a/docs/images/graphs/dep_graph_core_domain.svg b/docs/images/graphs/dep_graph_core_domain.svg deleted file mode 100644 index fe3740d2f..000000000 --- a/docs/images/graphs/dep_graph_core_domain.svg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - :core:domain - - - - :core:data - - - - - - - - :core:model - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:analytics - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_model.svg b/docs/images/graphs/dep_graph_core_model.svg deleted file mode 100644 index 125684a08..000000000 --- a/docs/images/graphs/dep_graph_core_model.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - :core:model - - - diff --git a/docs/images/graphs/dep_graph_core_network.svg b/docs/images/graphs/dep_graph_core_network.svg deleted file mode 100644 index 3022a86ee..000000000 --- a/docs/images/graphs/dep_graph_core_network.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - :core:network - - - - :core:common - - - - - - - - :core:model - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_notifications.svg b/docs/images/graphs/dep_graph_core_notifications.svg deleted file mode 100644 index d96d28769..000000000 --- a/docs/images/graphs/dep_graph_core_notifications.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - :core:notifications - - - - :core:model - - - - - - - - :core:common - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_screenshot_testing.svg b/docs/images/graphs/dep_graph_core_screenshot_testing.svg deleted file mode 100644 index a7d58b0ea..000000000 --- a/docs/images/graphs/dep_graph_core_screenshot_testing.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - :core:screenshot-testing - - - - :core:designsystem - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_testing.svg b/docs/images/graphs/dep_graph_core_testing.svg deleted file mode 100644 index d441858e5..000000000 --- a/docs/images/graphs/dep_graph_core_testing.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - :core:testing - - - - :core:analytics - - - - - - - - :core:common - - - - - - - - :core:data - - - - - - - - :core:model - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_core_ui.svg b/docs/images/graphs/dep_graph_core_ui.svg deleted file mode 100644 index 2cd972357..000000000 --- a/docs/images/graphs/dep_graph_core_ui.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - :core:ui - - - - :core:analytics - - - - - - - - :core:designsystem - - - - - - - - :core:model - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_bookmarks.svg b/docs/images/graphs/dep_graph_feature_bookmarks.svg deleted file mode 100644 index 0391eb39c..000000000 --- a/docs/images/graphs/dep_graph_feature_bookmarks.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - :feature:bookmarks - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_foryou.svg b/docs/images/graphs/dep_graph_feature_foryou.svg deleted file mode 100644 index 63a154a87..000000000 --- a/docs/images/graphs/dep_graph_feature_foryou.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - :feature:foryou - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - :core:domain - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_interests.svg b/docs/images/graphs/dep_graph_feature_interests.svg deleted file mode 100644 index 2de1fc61f..000000000 --- a/docs/images/graphs/dep_graph_feature_interests.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - :feature:interests - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - :core:domain - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_search.svg b/docs/images/graphs/dep_graph_feature_search.svg deleted file mode 100644 index 7f8f29777..000000000 --- a/docs/images/graphs/dep_graph_feature_search.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - :feature:search - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - :core:domain - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_settings.svg b/docs/images/graphs/dep_graph_feature_settings.svg deleted file mode 100644 index 3f0d35df2..000000000 --- a/docs/images/graphs/dep_graph_feature_settings.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - :feature:settings - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_feature_topic.svg b/docs/images/graphs/dep_graph_feature_topic.svg deleted file mode 100644 index b7c7dd26c..000000000 --- a/docs/images/graphs/dep_graph_feature_topic.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - :feature:topic - - - - :core:ui - - - - - - - - :core:designsystem - - - - - - - - :core:data - - - - - - - - - - - - :core:analytics - - - - - - - - :core:model - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_sync_sync_test.svg b/docs/images/graphs/dep_graph_sync_sync_test.svg deleted file mode 100644 index 7a083ba54..000000000 --- a/docs/images/graphs/dep_graph_sync_sync_test.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - :sync:sync-test - - - - :core:data - - - - - - - - :sync:work - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:analytics - - - - - - - - :core:notifications - - - - - - - - - - - - - - - - :core:model - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/graphs/dep_graph_sync_work.svg b/docs/images/graphs/dep_graph_sync_work.svg deleted file mode 100644 index c649f2397..000000000 --- a/docs/images/graphs/dep_graph_sync_work.svg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - :sync:work - - - - :core:analytics - - - - - - - - :core:data - - - - - - - - - - - - :core:common - - - - - - - - :core:database - - - - - - - - :core:datastore - - - - - - - - :core:network - - - - - - - - :core:notifications - - - - - - - - :core:model - - - - - - - - - - - - - - - - :core:datastore-proto - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/modularization-graph.drawio.png b/docs/images/modularization-graph.drawio.png deleted file mode 100644 index fb5bc375b..000000000 Binary files a/docs/images/modularization-graph.drawio.png and /dev/null differ diff --git a/feature/bookmarks/README.md b/feature/bookmarks/README.md index 54cbf91d0..c105a914e 100644 --- a/feature/bookmarks/README.md +++ b/feature/bookmarks/README.md @@ -1,3 +1,61 @@ -# :feature:bookmarks module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_bookmarks.svg) +# `:feature:bookmarks` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:bookmarks[bookmarks]:::android-feature + 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:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :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; +``` + diff --git a/feature/foryou/README.md b/feature/foryou/README.md index 0f08cb827..bd4517694 100644 --- a/feature/foryou/README.md +++ b/feature/foryou/README.md @@ -1,3 +1,66 @@ -# :feature:foryou module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_foryou.svg) +# `:feature:foryou` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:foryou[foryou]:::android-feature + 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:foryou -.-> :core:data + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :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; +``` + diff --git a/feature/interests/README.md b/feature/interests/README.md index 90a4fbc9c..423dd2da3 100644 --- a/feature/interests/README.md +++ b/feature/interests/README.md @@ -1,3 +1,65 @@ -# :feature:interests module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_interests.svg) +# `:feature:interests` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:interests[interests]:::android-feature + 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 -.-> :core:data + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :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; +``` + diff --git a/feature/search/README.md b/feature/search/README.md index e205970f0..ffaa130f9 100644 --- a/feature/search/README.md +++ b/feature/search/README.md @@ -1,3 +1,65 @@ -# :feature:search module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_search.svg) +# `:feature:search` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:domain[domain]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:search[search]:::android-feature + 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:search -.-> :core:data + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :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; +``` + diff --git a/feature/settings/README.md b/feature/settings/README.md index 7a4df04fe..6440cc4c9 100644 --- a/feature/settings/README.md +++ b/feature/settings/README.md @@ -1,3 +1,61 @@ -# :feature:settings module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_settings.svg) +# `:feature:settings` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:settings[settings]:::android-feature + 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:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :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; +``` + diff --git a/feature/topic/README.md b/feature/topic/README.md index 84588929c..df25443b3 100644 --- a/feature/topic/README.md +++ b/feature/topic/README.md @@ -1,3 +1,61 @@ -# :feature:topic module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_feature_topic.svg) +# `:feature:topic` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:designsystem[designsystem]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library + end + subgraph :feature + direction TB + :feature:topic[topic]:::android-feature + 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 -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :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; +``` + diff --git a/generateModuleGraphs.sh b/generateModuleGraphs.sh deleted file mode 100755 index 5307d2932..000000000 --- a/generateModuleGraphs.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# -# Copyright 2024 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. -# -# -# Script to generate dependency graphs for each of the modules. The --exclude-module parameter can -# be used to exclude modules which are not part of the root dependency graph (and which, if included -# would cause the script to fail. -# -# Usage: generateModuleGraphs.sh --exclude-module :benchmarks --exclude-module :lint --exclude-module :ui-test-hilt-manifest - -# Check if the dot command is available -if ! command -v dot &> /dev/null -then - echo "The 'dot' command is not found. This is required to generate SVGs from the Graphviz files." - echo "Installation instructions:" - echo " - On macOS: You can install Graphviz using Homebrew with the command: 'brew install graphviz'" - echo " - On Ubuntu: You can install Graphviz using APT with the command: 'sudo apt install graphviz'" - echo " - Others: Visit https://graphviz.org/download/" - exit 1 -fi - -# Check if the svgo command is available -if ! command -v svgo &> /dev/null -then - echo "The 'svgo' command is not found. This is required to cleanup and compress SVGs." - echo "Installation instructions available at https://github.com/svg/svgo." - exit 1 -fi - -# Check for a version of grep which supports Perl regex. -# On MacOS the OS installed grep doesn't support Perl regex so check for the existence of the -# GNU version instead which is prefixed with 'g' to distinguish it from the OS installed version. - if grep -P "" /dev/null > /dev/null 2>&1; then - GREP_COMMAND=grep -elif command -v ggrep &> /dev/null; then - GREP_COMMAND=ggrep -else - echo "You don't have a version of 'grep' installed which supports Perl regular expressions." - echo "On MacOS you can install one using Homebrew with the command: 'brew install grep'" - exit 1 -fi - -# Initialize an array to store excluded modules -excluded_modules=() - -# Parse command-line arguments for excluded modules -while [[ $# -gt 0 ]]; do - case "$1" in - --exclude-module) - excluded_modules+=("$2") - shift # Past argument - shift # Past value - ;; - *) - echo "Unknown parameter passed: $1" - exit 1 - ;; - esac -done - -# Get the module paths -module_paths=$(${GREP_COMMAND} -oP 'include\("\K[^"]+' settings.gradle.kts) - -# Ensure the output directory exists -mkdir -p docs/images/graphs/ - -# Function to check and create a README.md for modules which don't have one. -check_and_create_readme() { - local module_path="$1" - local file_name="$2" - - local readme_path="${module_path:1}" # Remove leading colon - readme_path=${readme_path//:/\/} # Replace colons with slashes - readme_path="${readme_path}/README.md" #Append the filename - - # Check if README.md exists and create it if not - if [[ ! -f "$readme_path" ]]; then - echo "Creating README.md for ${module_path}" - - # Determine the depth of the module based on the number of colons - local depth=$(awk -F: '{print NF-1}' <<< "${module_path}") - - # Construct the relative image path with the correct number of "../" - local relative_image_path="../" - for ((i=1; i<$depth; i++)); do - relative_image_path+="../" - done - relative_image_path+="docs/images/graphs/${file_name}.svg" - - echo "# ${module_path} module" > "$readme_path" - echo "## Dependency graph" >> "$readme_path" - echo "![Dependency graph](${relative_image_path})" >> "$readme_path" - fi -} - -# Loop through each module path -echo "$module_paths" | while read -r module_path; do - # Check if the module is in the excluded list - if [[ ! " ${excluded_modules[@]} " =~ " ${module_path} " ]]; then - # Derive the filename from the module path - file_name="dep_graph${module_path//:/_}" # Replace colons with underscores - file_name="${file_name//-/_}" # Replace dashes with underscores - - check_and_create_readme "$module_path" "$file_name" - - # Generate the .gv file in a temporary location - # +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + :lint[lint]:::unknown + +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/sync/sync-test/README.md b/sync/sync-test/README.md index 78876290f..0a4feaa46 100644 --- a/sync/sync-test/README.md +++ b/sync/sync-test/README.md @@ -1,3 +1,59 @@ -# :sync:sync-test module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_sync_sync_test.svg) +# `:sync:sync-test` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + end + subgraph :sync + direction TB + :sync:sync-test[sync-test]:::android-library + :sync:work[work]:::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 + :sync:sync-test -.-> :core:data + :sync:sync-test -.-> :sync:work + :sync:work -.-> :core:analytics + :sync:work -.-> :core:data + :sync:work -.-> :core:notifications + +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/sync/work/README.md b/sync/work/README.md index 2fe66d616..e39919a7e 100644 --- a/sync/work/README.md +++ b/sync/work/README.md @@ -1,3 +1,56 @@ -# :sync:work module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_sync_work.svg) +# `:sync:work` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + 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]:::android-library + :core:model[model]:::jvm-library + :core:network[network]:::android-library + :core:notifications[notifications]:::android-library + end + subgraph :sync + direction TB + :sync:work[work]:::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 + :sync:work -.-> :core:analytics + :sync:work -.-> :core:data + :sync:work -.-> :core:notifications + +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/ui-test-hilt-manifest/README.md b/ui-test-hilt-manifest/README.md new file mode 100644 index 000000000..2b33713b1 --- /dev/null +++ b/ui-test-hilt-manifest/README.md @@ -0,0 +1,23 @@ +# `:ui-test-hilt-manifest` + +## Module dependency graph + + +```mermaid +--- +config: + layout: elk + elk: + nodePlacementStrategy: SIMPLE +--- +graph TB + :ui-test-hilt-manifest[ui-test-hilt-manifest]:::android-library + +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; +``` +