Skip to content

Commit cd38d8a

Browse files
authored
Merge pull request #1953 from SimonMarquis/graphs
🧜‍♀️ Mermaid Graphs
2 parents 974d6b8 + c21ce2d commit cd38d8a

File tree

64 files changed

+1754
-2311
lines changed

Some content is hidden

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

64 files changed

+1754
-2311
lines changed

.github/workflows/Build.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ jobs:
7777
disable_globbing: true
7878
commit_message: "🤖 Updates baselines for Dependency Guard"
7979

80+
- name: Update Graphs
81+
run: ./gradlew graphUpdate
82+
83+
- name: Check Graphs
84+
id: graphs_verify
85+
run: git add -- '**/README.md' && git diff --cached --quiet --exit-code -- '**/README.md'
86+
87+
- name: Prevent updating graphs if this is a fork
88+
id: checkfork_graphs
89+
continue-on-error: false
90+
if: steps.graphs_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
91+
run: |
92+
echo "::error::Check Graphs failed, please update graphs with: ./gradlew graphUpdate" && exit 1
93+
94+
- name: Push new graphs if available
95+
if: steps.graphs_verify.outcome == 'failure' && github.event_name == 'pull_request'
96+
uses: stefanzweifel/git-auto-commit-action@v5
97+
with:
98+
file_pattern: '**/README.md'
99+
disable_globbing: true
100+
commit_message: "🤖 Updates graphs"
101+
80102
- name: Run all local screenshot tests (Roborazzi)
81103
id: screenshotsverify
82104
continue-on-error: true

app-nia-catalog/README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1-
# :app-nia-catalog module
2-
## Dependency graph
3-
![Dependency graph](../docs/images/graphs/dep_graph_app_nia_catalog.svg)
1+
# `:app-nia-catalog`
2+
3+
## Module dependency graph
4+
5+
<!--region graph-->
6+
```mermaid
7+
---
8+
config:
9+
layout: elk
10+
elk:
11+
nodePlacementStrategy: SIMPLE
12+
---
13+
graph TB
14+
subgraph :core
15+
direction TB
16+
:core:analytics[analytics]:::android-library
17+
:core:designsystem[designsystem]:::android-library
18+
:core:model[model]:::jvm-library
19+
:core:ui[ui]:::android-library
20+
end
21+
:app-nia-catalog[app-nia-catalog]:::android-application
22+
23+
:app-nia-catalog -.-> :core:designsystem
24+
:app-nia-catalog -.-> :core:ui
25+
:core:ui ---> :core:analytics
26+
:core:ui ---> :core:designsystem
27+
:core:ui ---> :core:model
28+
29+
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
30+
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
31+
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
32+
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
33+
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
34+
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
35+
```
36+
<!--endregion-->

app/README.md

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,112 @@
1-
# :app module
2-
## Dependency graph
3-
![Dependency graph](../docs/images/graphs/dep_graph_app.svg)
1+
# `:app`
2+
3+
## Module dependency graph
4+
5+
<!--region graph-->
6+
```mermaid
7+
---
8+
config:
9+
layout: elk
10+
elk:
11+
nodePlacementStrategy: SIMPLE
12+
---
13+
graph TB
14+
subgraph :core
15+
direction TB
16+
:core:analytics[analytics]:::android-library
17+
:core:common[common]:::jvm-library
18+
:core:data[data]:::android-library
19+
:core:database[database]:::android-library
20+
:core:datastore[datastore]:::android-library
21+
:core:datastore-proto[datastore-proto]:::android-library
22+
:core:designsystem[designsystem]:::android-library
23+
:core:domain[domain]:::android-library
24+
:core:model[model]:::jvm-library
25+
:core:network[network]:::android-library
26+
:core:notifications[notifications]:::android-library
27+
:core:ui[ui]:::android-library
28+
end
29+
subgraph :feature
30+
direction TB
31+
:feature:bookmarks[bookmarks]:::android-feature
32+
:feature:foryou[foryou]:::android-feature
33+
:feature:interests[interests]:::android-feature
34+
:feature:search[search]:::android-feature
35+
:feature:settings[settings]:::android-feature
36+
:feature:topic[topic]:::android-feature
37+
end
38+
subgraph :sync
39+
direction TB
40+
:sync:work[work]:::android-library
41+
end
42+
:benchmarks[benchmarks]:::android-test
43+
:app[app]:::android-application
44+
45+
:app -.->|baselineProfile| :benchmarks
46+
:app -.-> :core:analytics
47+
:app -.-> :core:common
48+
:app -.-> :core:data
49+
:app -.-> :core:designsystem
50+
:app -.-> :core:model
51+
:app -.-> :core:ui
52+
:app -.-> :feature:bookmarks
53+
:app -.-> :feature:foryou
54+
:app -.-> :feature:interests
55+
:app -.-> :feature:search
56+
:app -.-> :feature:settings
57+
:app -.-> :feature:topic
58+
:app -.-> :sync:work
59+
:benchmarks -.->|testedApks| :app
60+
:core:data -.-> :core:analytics
61+
:core:data ---> :core:common
62+
:core:data ---> :core:database
63+
:core:data ---> :core:datastore
64+
:core:data ---> :core:network
65+
:core:data -.-> :core:notifications
66+
:core:database ---> :core:model
67+
:core:datastore -.-> :core:common
68+
:core:datastore ---> :core:datastore-proto
69+
:core:datastore ---> :core:model
70+
:core:domain ---> :core:data
71+
:core:domain ---> :core:model
72+
:core:network ---> :core:common
73+
:core:network ---> :core:model
74+
:core:notifications -.-> :core:common
75+
:core:notifications ---> :core:model
76+
:core:ui ---> :core:analytics
77+
:core:ui ---> :core:designsystem
78+
:core:ui ---> :core:model
79+
:feature:bookmarks -.-> :core:data
80+
:feature:bookmarks -.-> :core:designsystem
81+
:feature:bookmarks -.-> :core:ui
82+
:feature:foryou -.-> :core:data
83+
:feature:foryou -.-> :core:designsystem
84+
:feature:foryou -.-> :core:domain
85+
:feature:foryou -.-> :core:notifications
86+
:feature:foryou -.-> :core:ui
87+
:feature:interests -.-> :core:data
88+
:feature:interests -.-> :core:designsystem
89+
:feature:interests -.-> :core:domain
90+
:feature:interests -.-> :core:ui
91+
:feature:search -.-> :core:data
92+
:feature:search -.-> :core:designsystem
93+
:feature:search -.-> :core:domain
94+
:feature:search -.-> :core:ui
95+
:feature:settings -.-> :core:data
96+
:feature:settings -.-> :core:designsystem
97+
:feature:settings -.-> :core:ui
98+
:feature:topic -.-> :core:data
99+
:feature:topic -.-> :core:designsystem
100+
:feature:topic -.-> :core:ui
101+
:sync:work -.-> :core:analytics
102+
:sync:work -.-> :core:data
103+
:sync:work -.-> :core:notifications
104+
105+
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
106+
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
107+
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
108+
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
109+
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
110+
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
111+
```
112+
<!--endregion-->

benchmarks/README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# `:benchmarks`
2+
3+
## Module dependency graph
4+
5+
<!--region graph-->
6+
```mermaid
7+
---
8+
config:
9+
layout: elk
10+
elk:
11+
nodePlacementStrategy: SIMPLE
12+
---
13+
graph TB
14+
subgraph :core
15+
direction TB
16+
:core:analytics[analytics]:::android-library
17+
:core:common[common]:::jvm-library
18+
:core:data[data]:::android-library
19+
:core:database[database]:::android-library
20+
:core:datastore[datastore]:::android-library
21+
:core:datastore-proto[datastore-proto]:::android-library
22+
:core:designsystem[designsystem]:::android-library
23+
:core:domain[domain]:::android-library
24+
:core:model[model]:::jvm-library
25+
:core:network[network]:::android-library
26+
:core:notifications[notifications]:::android-library
27+
:core:ui[ui]:::android-library
28+
end
29+
subgraph :feature
30+
direction TB
31+
:feature:bookmarks[bookmarks]:::android-feature
32+
:feature:foryou[foryou]:::android-feature
33+
:feature:interests[interests]:::android-feature
34+
:feature:search[search]:::android-feature
35+
:feature:settings[settings]:::android-feature
36+
:feature:topic[topic]:::android-feature
37+
end
38+
subgraph :sync
39+
direction TB
40+
:sync:work[work]:::android-library
41+
end
42+
:benchmarks[benchmarks]:::android-test
43+
:app[app]:::android-application
44+
45+
:app -.->|baselineProfile| :benchmarks
46+
:app -.-> :core:analytics
47+
:app -.-> :core:common
48+
:app -.-> :core:data
49+
:app -.-> :core:designsystem
50+
:app -.-> :core:model
51+
:app -.-> :core:ui
52+
:app -.-> :feature:bookmarks
53+
:app -.-> :feature:foryou
54+
:app -.-> :feature:interests
55+
:app -.-> :feature:search
56+
:app -.-> :feature:settings
57+
:app -.-> :feature:topic
58+
:app -.-> :sync:work
59+
:benchmarks -.->|testedApks| :app
60+
:core:data -.-> :core:analytics
61+
:core:data ---> :core:common
62+
:core:data ---> :core:database
63+
:core:data ---> :core:datastore
64+
:core:data ---> :core:network
65+
:core:data -.-> :core:notifications
66+
:core:database ---> :core:model
67+
:core:datastore -.-> :core:common
68+
:core:datastore ---> :core:datastore-proto
69+
:core:datastore ---> :core:model
70+
:core:domain ---> :core:data
71+
:core:domain ---> :core:model
72+
:core:network ---> :core:common
73+
:core:network ---> :core:model
74+
:core:notifications -.-> :core:common
75+
:core:notifications ---> :core:model
76+
:core:ui ---> :core:analytics
77+
:core:ui ---> :core:designsystem
78+
:core:ui ---> :core:model
79+
:feature:bookmarks -.-> :core:data
80+
:feature:bookmarks -.-> :core:designsystem
81+
:feature:bookmarks -.-> :core:ui
82+
:feature:foryou -.-> :core:data
83+
:feature:foryou -.-> :core:designsystem
84+
:feature:foryou -.-> :core:domain
85+
:feature:foryou -.-> :core:notifications
86+
:feature:foryou -.-> :core:ui
87+
:feature:interests -.-> :core:data
88+
:feature:interests -.-> :core:designsystem
89+
:feature:interests -.-> :core:domain
90+
:feature:interests -.-> :core:ui
91+
:feature:search -.-> :core:data
92+
:feature:search -.-> :core:designsystem
93+
:feature:search -.-> :core:domain
94+
:feature:search -.-> :core:ui
95+
:feature:settings -.-> :core:data
96+
:feature:settings -.-> :core:designsystem
97+
:feature:settings -.-> :core:ui
98+
:feature:topic -.-> :core:data
99+
:feature:topic -.-> :core:designsystem
100+
:feature:topic -.-> :core:ui
101+
:sync:work -.-> :core:analytics
102+
:sync:work -.-> :core:data
103+
:sync:work -.-> :core:notifications
104+
105+
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
106+
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
107+
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
108+
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
109+
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
110+
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
111+
```
112+
<!--endregion-->

build-logic/convention/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,9 @@ gradlePlugin {
114114
id = libs.plugins.nowinandroid.jvm.library.get().pluginId
115115
implementationClass = "JvmLibraryConventionPlugin"
116116
}
117+
register("root") {
118+
id = libs.plugins.nowinandroid.root.get().pluginId
119+
implementationClass = "RootPlugin"
120+
}
117121
}
118122
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import com.google.samples.apps.nowinandroid.configureGraphTasks
18+
import org.gradle.api.Plugin
19+
import org.gradle.api.Project
20+
21+
class RootPlugin : Plugin<Project> {
22+
override fun apply(target: Project) {
23+
require(target.path == ":")
24+
target.subprojects { configureGraphTasks() }
25+
}
26+
}

0 commit comments

Comments
 (0)