Skip to content

Commit

Permalink
Expose cc_proto_aspect as a toplevel symbol.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 520619683
Change-Id: Ief39fdc3ea9083c22fbf12d2b4ba79482c3c16bf
  • Loading branch information
buildbreaker2021 authored and copybara-github committed Mar 30, 2023
1 parent 24b4589 commit 2aa06cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {
builder.addConfigurationFragment(CppConfiguration.class);
builder.addStarlarkAccessibleTopLevels("CcSharedLibraryInfo", Starlark.NONE);
builder.addStarlarkAccessibleTopLevels("CcSharedLibraryHintInfo", Starlark.NONE);
builder.addStarlarkAccessibleTopLevels("cc_proto_aspect", Starlark.NONE);
builder.addBuildInfoFactory(new CppBuildInfo());

builder.addNativeAspectClass(graphNodeAspect);
Expand Down
3 changes: 2 additions & 1 deletion src/main/starlark/builtins_bzl/bazel/exports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ load("@_builtins//:common/java/java_library.bzl", "JAVA_LIBRARY_ATTRS", "bazel_j
load("@_builtins//:common/java/java_plugin.bzl", "java_plugin")
load("@_builtins//:common/java/java_import.bzl", "java_import")
load("@_builtins//:common/java/proto/java_proto_library.bzl", "java_proto_library")
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_library")
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_aspect", "cc_proto_library")
load(":bazel/java/bazel_java_binary_wrapper.bzl", "java_binary", "java_test")
load("@_builtins//:common/python/py_binary_macro.bzl", "py_binary")
load("@_builtins//:common/python/py_library_macro.bzl", "py_library")
Expand All @@ -32,6 +32,7 @@ exported_toplevels = {
bazel_java_library_rule = bazel_java_library_rule,
JAVA_LIBRARY_ATTRS = JAVA_LIBRARY_ATTRS,
),
"cc_proto_aspect": cc_proto_aspect,
}
exported_rules = {
"java_library": java_library,
Expand Down
4 changes: 2 additions & 2 deletions src/main/starlark/builtins_bzl/common/cc/cc_proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def _aspect_impl(target, ctx):
providers.append(header_provider)
return providers

_cc_proto_aspect = aspect(
cc_proto_aspect = aspect(
implementation = _aspect_impl,
attr_aspects = ["deps"],
fragments = ["cpp", "proto"],
Expand Down Expand Up @@ -289,7 +289,7 @@ cc_proto_library = rule(
implementation = _impl,
attrs = {
"deps": attr.label_list(
aspects = [_cc_proto_aspect],
aspects = [cc_proto_aspect],
allow_rules = ["proto_library"],
allow_files = False,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class CcProtoLibraryTest extends BuildViewTestCase {
private final StarlarkAspectClass starlarkCcProtoAspect =
new StarlarkAspectClass(
Label.parseCanonicalUnchecked("@_builtins//:common/cc/cc_proto_library.bzl"),
"_cc_proto_aspect");
"cc_proto_aspect");

@Before
public void setUp() throws Exception {
Expand Down

0 comments on commit 2aa06cf

Please sign in to comment.