How do I query only for the dependencies declared under deps?
For example, given the given target
java_library(
name = "my-library",
srcs = glob(["src/main/java/**/*.java"]),
deps = [
":some-target",
"//some-package:another-target",
artifact("some-maven:some-artifact"),
artifact("another-maven:another-artifact"),
],
)
How do I query just the dependencies directly defined in deps? That is,
":some-target",
"//some-package:another-target",
artifact("some-maven:some-artifact"),
artifact("another-maven:another-artifact"),
bazel query deps(my-library) returns me many other dependencies I am not interested in (e.g. source files, platform targets, other internal targets, etc.).
Download buildozer from here. Add buildozer to your environment path.
This will list what can be found in the
depsattribute, e.g.:Builddozer just gives you a text copy of what can be found in the
depsattribute. There will be no transitive dependencies and things like selectes will not be resolved.In contrast using Bazel's
cqueryyou can get all dependencies including transitive ones without source files this way: