blob: 20b5077a13cba2c8cd8d2cf2d85adf3366de8f8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"
|