Merge pull request #1257 from android/dt/add-module-graphs
Update module dependency graphs and add script to create themja/coverage
@ -1,3 +1,3 @@
|
|||||||
# :app-nia-catalog module
|
# :app-nia-catalog module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../docs/images/graphs/dep_graph_app_nia_catalog.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_app_nia_catalog.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :app module
|
# :app module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../docs/images/graphs/dep_graph_app.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_app.svg)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
# :core:analytics module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_analytics.svg)
|
@ -1,3 +1,3 @@
|
|||||||
# :core:common module
|
# :core:common module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_common.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_common.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:data-test module
|
# :core:data-test module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_data_test.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_data_test.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:data module
|
# :core:data module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_data.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_data.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:database module
|
# :core:database module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_database.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_database.svg)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
# :core:datastore-proto module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_proto.svg)
|
@ -1,3 +1,3 @@
|
|||||||
# :core:datastore-test module
|
# :core:datastore-test module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_test.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_test.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:datastore module
|
# :core:datastore module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:designsystem module
|
# :core:designsystem module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_designsystem.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_designsystem.svg)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
# :core:domain module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_domain.svg)
|
@ -1,3 +1,3 @@
|
|||||||
# :core:model module
|
# :core:model module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_model.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_model.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:network module
|
# :core:network module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_network.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_network.svg)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
# :core:notifications module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_notifications.svg)
|
@ -0,0 +1,3 @@
|
|||||||
|
# :core:screenshot-testing module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_screenshot_testing.svg)
|
@ -1,3 +1,3 @@
|
|||||||
# :core:testing module
|
# :core:testing module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_testing.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_testing.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :core:ui module
|
# :core:ui module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_core_ui.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_core_ui.svg)
|
||||||
|
Before Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 863 B |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 893 B |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 872 B |
After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 8.8 KiB |
@ -1,3 +1,3 @@
|
|||||||
# :feature:bookmarks module
|
# :feature:bookmarks module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_feature_bookmarks.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_bookmarks.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :feature:foryou module
|
# :feature:foryou module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_feature_foryou.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_foryou.svg)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# :feature:interests module
|
# :feature:interests module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_feature_interests.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_interests.svg)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
# :feature:search module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_search.svg)
|
@ -0,0 +1,3 @@
|
|||||||
|
# :feature:settings module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_settings.svg)
|
@ -1,3 +1,3 @@
|
|||||||
# :feature:topic module
|
# :feature:topic module
|
||||||
|
## Dependency graph
|
||||||
![Dependency graph](../../docs/images/graphs/dep_graph_feature_topic.png)
|
![Dependency graph](../../docs/images/graphs/dep_graph_feature_topic.svg)
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
#!/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 "On macOS, you can install it using Homebrew: 'brew install graphviz'"
|
||||||
|
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=$(./gradlew -q printModulePaths --no-configuration-cache)
|
||||||
|
|
||||||
|
# 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 using sed
|
||||||
|
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}"
|
||||||
|
# Calculate the correct relative path to the image
|
||||||
|
local 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
|
||||||
|
# </dev/null is used to stop ./gradlew from consuming input which prematurely ends the while loop
|
||||||
|
./gradlew generateModulesGraphvizText \
|
||||||
|
-Pmodules.graph.output.gv="/tmp/${file_name}.gv" \
|
||||||
|
-Pmodules.graph.of.module="${module_path}" </dev/null
|
||||||
|
|
||||||
|
# Convert to SVG using dot
|
||||||
|
dot -Tsvg "/tmp/${file_name}.gv" > "docs/images/graphs/${file_name}.svg"
|
||||||
|
# Remove the temporary .gv file
|
||||||
|
rm "/tmp/${file_name}.gv"
|
||||||
|
fi
|
||||||
|
done
|
@ -1,3 +0,0 @@
|
|||||||
# :lint module
|
|
||||||
|
|
||||||
![Dependency graph](../docs/images/graphs/dep_graph_lint.png)
|
|
@ -1,3 +0,0 @@
|
|||||||
# :sync module
|
|
||||||
|
|
||||||
![Dependency graph](../docs/images/graphs/dep_graph_sync.png)
|
|
@ -0,0 +1,3 @@
|
|||||||
|
# :sync:sync-test module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_sync_sync_test.svg)
|
@ -0,0 +1,3 @@
|
|||||||
|
# :sync:work module
|
||||||
|
## Dependency graph
|
||||||
|
![Dependency graph](../../docs/images/graphs/dep_graph_sync_work.svg)
|