unused_deps is a command line tool to determine any unused dependencies
in java_library
rules. targets. It outputs buildozer
commands to apply the suggested
prunings.
- Protobuf go runtime: to download (if not using bazel)
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
- Change directory to the buildifier/unused_deps
gopath=$(go env GOPATH)
cd $gopath/src/github.com/bazelbuild/buildtools/unused_deps
- Install
go install
unused_deps TARGET...
Here, TARGET
is a space-separated list of Bazel labels, with support for :all
and ...