Allow setting a copy_to_dist_dir's visibility attribute.
If another rule (e.g. another exec rule) in another package wants to use
a given copy_to_dist_dir macro, that rule's visibility will have to be
correctly set.
This CL allows setting the underlying embedded_exec's visiblity
attribute.
Test: Created an exec rule that referenced a copy_to_dist_dir rule in
another package and successfully executed the exec rule.
Change-Id: I2efca7ac30f11c4961c2e30d752970be81fcc962
diff --git a/dist/dist.bzl b/dist/dist.bzl
index 53a98a0..19626bc 100644
--- a/dist/dist.bzl
+++ b/dist/dist.bzl
@@ -63,7 +63,8 @@
flat = None,
prefix = None,
archive_prefix = None,
- dist_dir = None):
+ dist_dir = None,
+ **kwargs):
"""A dist rule to copy files out of Bazel's output directory into a custom location.
Example:
@@ -90,6 +91,10 @@
In particular, if this is a relative path, it is interpreted as a relative path
under workspace root when the target is executed with `bazel run`.
See details by running the target with `--help`.
+ kwargs: Additional attributes to the internal rule, e.g.
+ [`visibility`](https://docs.bazel.build/versions/main/visibility.html).
+
+ These additional attributes are only passed to the underlying embedded_exec rule.
"""
default_args = []
@@ -130,4 +135,5 @@
embedded_exec(
name = name,
actual = name + "_internal",
+ **kwargs
)