summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-03-25 23:28:50 +0100
committerGitHub <noreply@github.com>2024-03-25 23:28:50 +0100
commit160089d3fffeb788464e23b36bc476a3e0cde183 (patch)
treef804c7e19f164b2884afa5a74d8932c60516a29e /scripts
parent69b24699a36bc9c4ffc6200fbcf8069f7a94c1ab (diff)
downloadAntennaPod-160089d3fffeb788464e23b36bc476a3e0cde183.zip
Add script to generate module diagram (#7028)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generateModuleDiagram.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/generateModuleDiagram.sh b/scripts/generateModuleDiagram.sh
new file mode 100644
index 000000000..20b5077a1
--- /dev/null
+++ b/scripts/generateModuleDiagram.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+echo "digraph modules {" | tee /tmp/antennapod-modules.dot
+modules=$(find . -name "build.gradle")
+for modulePath in $modules; do
+ name=$(echo $modulePath | sed -E 's/\.\/?(.*)\/build\.gradle/:\1/g' | sed -E 's/\//:/g')
+ dependencies=$(cat $modulePath | sed -nE "s/[ ]*implementation project\\(['\"](.*)['\"]\\)/\\1/p")
+ for dependency in $dependencies; do
+ echo "\"$name\" -> \"$dependency\";" | tee --append /tmp/antennapod-modules.dot
+ done
+done
+echo "}" | tee --append /tmp/antennapod-modules.dot
+
+tred /tmp/antennapod-modules.dot | dot -Tpng > moduleDiagram.png
+rm /tmp/antennapod-modules.dot
+echo "Wrote to moduleDiagram.png"