bazel: add java and gensignature rules and "fix" formatting of build rules
This CL adds the java and gensignature rules with them set to noop in
standalone builds - the can be overriden in internal settings.
Also "fixes" the formatting (even though it looks a lot worse) to match
what the internal formatting expects.
Bug: 140126865
Change-Id: I186f2205599aa835a59902eb5fd5266edd7df8ee
diff --git a/bazel/rules.bzl b/bazel/rules.bzl
index 0aca50e..87c48c7 100644
--- a/bazel/rules.bzl
+++ b/bazel/rules.bzl
@@ -56,6 +56,19 @@
if not _rule_override("cc_proto_library", **kwargs):
native.cc_proto_library(**kwargs)
+def perfetto_java_proto_library(**kwargs):
+ if not _rule_override("java_proto_library", **kwargs):
+ native.java_proto_library(**kwargs)
+
+# +----------------------------------------------------------------------------+
+# | Misc rules. |
+# +----------------------------------------------------------------------------+
+
+# Unlike all the other rules, this is an noop by default because Bazel does not
+# support gensignature.
+def perfetto_gensignature_internal_only(**kwargs):
+ _rule_override("gensignature_internal_only", **kwargs)
+
# Generates .pbzero.{cc,h} from .proto(s). We deliberately do NOT generate
# conventional .pb.{cc,h} from here as protozero gen sources do not have any
# dependency on libprotobuf.