bazeltools / bzl-gen-build

Apache License 2.0
11 stars 4 forks source link

Support polyglot BUILD.bazel ("Google3" layout) #169

Open eed3si9n opened 7 months ago

eed3si9n commented 7 months ago

problem

In a "Google3" layout, the source files are supposedly organized by their package names without language tags scala/ or distinction of main vs test:

Currently bzl-gen-build does not support Google3-like layout because one run would overwrite the BUILD.bazel file.

proposal

I wonder if we can support this use case if we implemented --append flag, and keep appending targets on the BUILD file.

eed3si9n commented 2 months ago

Currently the Google3 layout to colocate "main" and test targets in one package is limited to --no-aggregate-source mode. This works ok for cases like Protobuf, but I think we also want to aggregate by package in languages like Scala and Java, and potentially even Python to reduce the risk of dangling source files (sources that are added to git but not tracked by any target).