Fix aspect handling of go proto outputs.
@@ -217,8 +217,7 @@ def get_aspect_ids(ctx, target):
def _is_language_specific_proto_library(ctx, target):
"""Returns True if the target is a proto library with attached language-specific aspect."""
- return (ctx.rule.kind == "proto_library" and
- (JavaInfo in target or hasattr(target, "aspect_proto_go_api_info")))
+ return (ctx.rule.kind == "proto_library" and JavaInfo in target)
def make_target_key(label, aspect_ids):
"""Returns a TargetKey proto struct from a target."""
@@ -325,8 +324,8 @@ def collect_py_info(target, ctx, semantics, ide_info, ide_info_file, output_grou
def _collect_generated_proto_go_sources(target):
"""Returns a depset of proto go source files generated by this target."""
- if hasattr(target, "aspect_proto_go_api_info"):
- go_proto_info = target.aspect_proto_go_api_info
+ if hasattr(target, "proto_go_api_info"):
+ go_proto_info = target.proto_go_api_info
files = getattr(go_proto_info, "files_to_build", depset()).to_list()
elif hasattr(target[OutputGroupInfo], "go_generated_srcs"):
files = target[OutputGroupInfo].go_generated_srcs.to_list()
@@ -1022,5 +1021,5 @@ def make_intellij_info_aspect(aspect_impl, semantics):
attr_aspects = attr_aspects,
fragments = ["cpp"],
implementation = aspect_impl,
- required_aspect_providers = [[JavaInfo], ["aspect_proto_go_api_info"], ["dart"]],
+ required_aspect_providers = [[JavaInfo], ["dart"]],
)
