Last active
April 30, 2020 18:06
-
-
Save visortelle/ba1b9171f672e0acf060275f38cd4e33 to your computer and use it in GitHub Desktop.
bazel-bash-helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Print availabel bazel rules by path | |
## Usage bazel_rules '//src' | |
function bazel_rules(){ | |
bazel query "attr(name, \".*\", $@:*)" 2> /dev/null | |
} | |
## Print availabel bazel rules by path | |
## Usage bazel_public_rules '//src' | |
function bazel_public_rules() { | |
bazel query "attr(visibility, \"//visibility:public\", $@:*)" 2> /dev/null | |
} | |
## Build graphviz graph and put it into clipboard, then open webgraphviz.com in browser (MacOS only). | |
## Usage: bazel_graph '//src:build', then paste clipboard content into graph input. | |
function bazel_graph(){ | |
bazel query --notool_deps --noimplicit_deps "deps($@)" --output graph 2> /dev/null | pbcopy && open http://www.webgraphviz.com/ | |
} | |
## "bazlisk" is a version manager for bazel that respecting .bazelversion file. | |
## Repo: https://github.com/bazelbuild/bazelisk | |
alias bazel="bazelisk" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment