buildtools
buildtools copied to clipboard
Buildozer: Handle multiple glob arguments in 'set' arguments
Following on #100 and #99
Ideally, we'd find a more general solution.
The special case for single argument glob works fine, but with multiple arguments it again parses the glob as individual files.
$ buildozer 'set srcs glob(["*.c"])' //:foobar
fixed /.../buildozer/glob-multiple-args/BUILD.bazel
$ cat BUILD.bazel
cc_library(
name = "foobar",
srcs = glob(["*.c"]),
)
$ buildozer 'set srcs glob(["*.c", "*.h"])' //:foobar
fixed /.../buildozer/glob-multiple-args/BUILD.bazel
$ cat BUILD.bazel
cc_library(
name = "foobar",
srcs = [
"\"*.h\"])",
"glob([\"*.c\",",
],
)
I'll take a look and see if I can improve the special handling of globs here.