Skip to content

Exclude external dependencies in visualize_deps.sh in exaudfclient #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion exaudfclient/base/visualize_all.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bash visualize_deps.sh "//:exaudfclient //:exaudfclient_py3" $*
bash visualize_deps.sh //:exaudfclient //:exaudfclient_py3 "$@"
25 changes: 20 additions & 5 deletions exaudfclient/base/visualize_deps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
source .env
DEPS=""
for I in $1
for I in "$@"
do
echo "I: $I"
if [ "$DEPS" == "" ]
then
DEPS="deps($I)"
Expand All @@ -10,9 +11,23 @@ do
fi
done
DEPS="($DEPS)"
shift 1
bazel query $* --noimplicit_deps "$DEPS except (filter('@bazel_tools', $DEPS) union filter('@local_config',$DEPS))" --output graph | sed -e "s/label/xlabel/g" > graph.in

dot -Grank=max -Gsplines=ortho -Goverlap=false -Granksep=4 -Gnodesep=2 -Tpng < graph.in > graph.png
exclude_filter=""
declare -a excludes=("@bazel_tools" "@local_config" "@ssl" "@java" "@python3" "@python2" "@protobuf" "@numpy")
for exclude in "${excludes[@]}"
do
if [ "$exclude_filter" == "" ]
then
exclude_filter="filter('$exclude', $DEPS)"
else
exclude_filter="$exclude_filter union filter('$exclude', $DEPS)"
fi
done

bazel query --noimplicit_deps --nohost_deps "$DEPS except ($exclude_filter)" --output graph | sed -e "s/label/xlabel/g" > graph.in

dot -Tpng < graph.in > graph.png

#dot -Grank=max -Gsplines=ortho -Goverlap=false -Granksep=4 -Gnodesep=2 -Tpng < graph.in > graph.png

# -Gconcentrate=true -Gsplines=ortho -Nshape=box -Gconcentrate=true
# -Gconcentrate=true -Gsplines=ortho -Nshape=box -Gconcentrate=true