Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions app-nia-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ graph TB

:app-nia-catalog -.-> :core:designsystem
:app-nia-catalog -.-> :core:ui
:core:ui ---> :core:analytics
:core:ui ---> :core:designsystem
:core:ui ---> :core:model
: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;
Expand All @@ -33,4 +33,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
52 changes: 37 additions & 15 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,24 @@ graph TB
: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:common
:core:data --> :core:database
:core:data --> :core:datastore
:core:data --> :core:network
:core:data -.-> :core:notifications
:core:database ---> :core:model
: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: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
: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
Expand Down Expand Up @@ -109,4 +109,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
52 changes: 37 additions & 15 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,24 @@ graph TB
: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:common
:core:data --> :core:database
:core:data --> :core:datastore
:core:data --> :core:network
:core:data -.-> :core:notifications
:core:database ---> :core:model
: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: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
: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
Expand Down Expand Up @@ -109,4 +109,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ internal fun Project.configureGraphTasks() {
projectPath = [email protected]
dependencies = graph.dependencies()
plugins = graph.plugins()
output = [email protected]("mermaid.txt")
output = [email protected]("mermaid/graph.txt")
legend = [email protected]("mermaid/legend.txt")
}
tasks.register<GraphUpdateTask>("graphUpdate") {
projectPath = [email protected]
input = dumpTask.flatMap { it.output }
legend = dumpTask.flatMap { it.legend }
output = [email protected]("README.md")
}
}
Expand All @@ -156,11 +158,15 @@ private abstract class GraphDumpTask : DefaultTask() {
@get:OutputFile
abstract val output: RegularFileProperty

@get:OutputFile
abstract val legend: RegularFileProperty

override fun getDescription() = "Dumps project dependencies to a mermaid file."

@TaskAction
operator fun invoke() {
output.get().asFile.writeText(mermaid())
legend.get().asFile.writeText(legend())
logger.lifecycle(output.get().asFile.toPath().toUri().toString())
}

Expand Down Expand Up @@ -208,6 +214,27 @@ private abstract class GraphDumpTask : DefaultTask() {
PluginType.entries.forEach { appendLine(it.classDef()) }
}

private fun legend() = buildString {
appendLine("graph TB")
listOf(
"application" to PluginType.AndroidApplication,
"feature" to PluginType.AndroidFeature,
"library" to PluginType.AndroidLibrary,
"jvm" to PluginType.Jvm,
).forEach { (name, type) ->
appendLine(name.alias(indent = 2, type))
}
appendLine()
listOf(
Dependency("application", "implementation", "feature"),
Dependency("library", "api", "jvm"),
).forEach {
appendLine(it.link(indent = 2))
}
appendLine()
PluginType.entries.forEach { appendLine(it.classDef()) }
}

private class Dependency(val project: String, val configuration: String, val dependency: String)

private fun Pair<String, String>.toDependency(project: String) =
Expand All @@ -225,7 +252,7 @@ private abstract class GraphDumpTask : DefaultTask() {
append(project).append(" ")
append(
when (configuration) {
"api" -> "--->"
"api" -> "-->"
"implementation" -> "-.->"
else -> "-.->|$configuration|"
},
Expand All @@ -246,6 +273,10 @@ private abstract class GraphUpdateTask : DefaultTask() {
@get:PathSensitive(NONE)
abstract val input: RegularFileProperty

@get:InputFile
@get:PathSensitive(NONE)
abstract val legend: RegularFileProperty

@get:OutputFile
abstract val output: RegularFileProperty

Expand All @@ -266,15 +297,24 @@ private abstract class GraphUpdateTask : DefaultTask() {
""".trimIndent(),
)
}
val mermaid = input.get().asFile.readText().trimTrailingNewLines()
val legend = legend.get().asFile.readText().trimTrailingNewLines()
val regex = """(<!--region graph-->)(.*?)(<!--endregion-->)""".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
|```
|
|<details><summary>📋 Graph legend</summary>
|
|```mermaid
|$legend
|```
|
|</details>
|$end
""".trimMargin()
}
Expand Down
22 changes: 22 additions & 0 deletions core/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
22 changes: 22 additions & 0 deletions core/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
44 changes: 33 additions & 11 deletions core/data-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ graph TB
end

:core:data -.-> :core:analytics
:core:data ---> :core:common
:core:data ---> :core:database
:core:data ---> :core:datastore
:core:data ---> :core:network
: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: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: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: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;
Expand All @@ -48,4 +48,26 @@ 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;
```

<details><summary>📋 Graph legend</summary>

```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;
```

</details>
<!--endregion-->
Loading
Loading