How to use Buildozer to add many deps to one target

664 views
Skip to first unread message

ittai zeidman

unread,
Jan 10, 2018, 10:38:02 AM1/10/18
to bazel-discuss
Hi,
I have a need to add all targets under a sub package (`//foo/bar/...`) as a dependency to a specific target.
It sounds like Buildozer should be able to help me but I could only find how to add a dependency (or multiple explicitly listed dependencies) to many packages but not the other way around.
Any chance someone knows how this can be achieved?

Tobias Werth

unread,
Jan 10, 2018, 10:54:22 AM1/10/18
to ittai zeidman, bazel-discuss
buildozer allows you to specify multiple values for the deps command, see  https://github.com/bazelbuild/buildtools/tree/master/buildozer#edit-commands

e.g. buildozer 'add deps //x:b //x:c' //x:a

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/a202e45a-95ec-40ea-9bf6-a44e9a9ef7f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Tobias Werth
Software Engineer


Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado 
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. 
     
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

ittai zeidman

unread,
Jan 10, 2018, 11:07:42 AM1/10/18
to Tobias Werth, bazel-discuss
Thanks, I know. I wrote I know that one can add multiple deps explicitly but I was hoping to add a queryable expression.
Meanwhile I've solved it with something like:
bazel query 'src/main/java...' | xargs -I buildozer 'add deps %' //some/module/path/src/main/resources
Reply all
Reply to author
Forward
0 new messages