Clean grep_includes

PiperOrigin-RevId: 548496203
pull/13171/head
Nevena Kotlaja 1 year ago committed by Copybara-Service
parent 8c71bc4593
commit 1d8143c986
  1. 17
      bazel/upb_proto_library.bzl
  2. 13
      protos/bazel/upb_cc_proto_library.bzl

@ -412,15 +412,6 @@ def upb_proto_library_aspect_impl(target, ctx):
def _upb_proto_reflection_library_aspect_impl(target, ctx):
return _upb_proto_aspect_impl(target, ctx, "upbdefs", _UpbDefsWrappedCcInfo, _WrappedDefsGeneratedSrcsInfo, provide_cc_shared_library_hints = False)
def _maybe_add(d):
if _is_google3:
d["_grep_includes"] = attr.label(
allow_single_file = True,
cfg = "exec",
default = "@bazel_tools//tools/cpp:grep-includes",
)
return d
# upb_proto_library() ##########################################################
def _get_upb_proto_library_aspect_provides():
@ -438,7 +429,7 @@ def _get_upb_proto_library_aspect_provides():
return provides
upb_proto_library_aspect = aspect(
attrs = _maybe_add({
attrs = {
"_copts": attr.label(
default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use",
),
@ -459,7 +450,7 @@ upb_proto_library_aspect = aspect(
"//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
]),
"_fasttable_enabled": attr.label(default = "//:fasttable_enabled"),
}),
},
implementation = upb_proto_library_aspect_impl,
provides = _get_upb_proto_library_aspect_provides(),
attr_aspects = ["deps"],
@ -484,7 +475,7 @@ upb_proto_library = rule(
# upb_proto_reflection_library() ###############################################
_upb_proto_reflection_library_aspect = aspect(
attrs = _maybe_add({
attrs = {
"_copts": attr.label(
default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use",
),
@ -506,7 +497,7 @@ _upb_proto_reflection_library_aspect = aspect(
"//:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
],
),
}),
},
implementation = _upb_proto_reflection_library_aspect_impl,
provides = [
_UpbDefsWrappedCcInfo,

@ -244,17 +244,8 @@ def _upb_cc_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider
def _upb_cc_proto_library_aspect_impl(target, ctx):
return _upb_cc_proto_aspect_impl(target, ctx, "upbprotos", _UpbCcWrappedCcInfo, _WrappedCcGeneratedSrcsInfo)
def _maybe_add(d):
if _is_google3:
d["_grep_includes"] = attr.label(
allow_single_file = True,
cfg = "exec",
default = "@bazel_tools//tools/cpp:grep-includes",
)
return d
_upb_cc_proto_library_aspect = aspect(
attrs = _maybe_add({
attrs = {
"_ccopts": attr.label(
default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
),
@ -282,7 +273,7 @@ _upb_cc_proto_library_aspect = aspect(
"//protos:repeated_field",
],
),
}),
},
implementation = _upb_cc_proto_library_aspect_impl,
provides = [
_UpbCcWrappedCcInfo,

Loading…
Cancel
Save