Skip to content

Commit 2aa06cf

Browse files
buildbreaker2021copybara-github
authored andcommitted
Expose cc_proto_aspect as a toplevel symbol.
PiperOrigin-RevId: 520619683 Change-Id: Ief39fdc3ea9083c22fbf12d2b4ba79482c3c16bf
1 parent 24b4589 commit 2aa06cf

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/main/java/com/google/devtools/build/lib/bazel/rules/CcRules.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {
6666
builder.addConfigurationFragment(CppConfiguration.class);
6767
builder.addStarlarkAccessibleTopLevels("CcSharedLibraryInfo", Starlark.NONE);
6868
builder.addStarlarkAccessibleTopLevels("CcSharedLibraryHintInfo", Starlark.NONE);
69+
builder.addStarlarkAccessibleTopLevels("cc_proto_aspect", Starlark.NONE);
6970
builder.addBuildInfoFactory(new CppBuildInfo());
7071

7172
builder.addNativeAspectClass(graphNodeAspect);

src/main/starlark/builtins_bzl/bazel/exports.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ load("@_builtins//:common/java/java_library.bzl", "JAVA_LIBRARY_ATTRS", "bazel_j
1818
load("@_builtins//:common/java/java_plugin.bzl", "java_plugin")
1919
load("@_builtins//:common/java/java_import.bzl", "java_import")
2020
load("@_builtins//:common/java/proto/java_proto_library.bzl", "java_proto_library")
21-
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_library")
21+
load("@_builtins//:common/cc/cc_proto_library.bzl", "cc_proto_aspect", "cc_proto_library")
2222
load(":bazel/java/bazel_java_binary_wrapper.bzl", "java_binary", "java_test")
2323
load("@_builtins//:common/python/py_binary_macro.bzl", "py_binary")
2424
load("@_builtins//:common/python/py_library_macro.bzl", "py_library")
@@ -32,6 +32,7 @@ exported_toplevels = {
3232
bazel_java_library_rule = bazel_java_library_rule,
3333
JAVA_LIBRARY_ATTRS = JAVA_LIBRARY_ATTRS,
3434
),
35+
"cc_proto_aspect": cc_proto_aspect,
3536
}
3637
exported_rules = {
3738
"java_library": java_library,

src/main/starlark/builtins_bzl/common/cc/cc_proto_library.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _aspect_impl(target, ctx):
255255
providers.append(header_provider)
256256
return providers
257257

258-
_cc_proto_aspect = aspect(
258+
cc_proto_aspect = aspect(
259259
implementation = _aspect_impl,
260260
attr_aspects = ["deps"],
261261
fragments = ["cpp", "proto"],
@@ -289,7 +289,7 @@ cc_proto_library = rule(
289289
implementation = _impl,
290290
attrs = {
291291
"deps": attr.label_list(
292-
aspects = [_cc_proto_aspect],
292+
aspects = [cc_proto_aspect],
293293
allow_rules = ["proto_library"],
294294
allow_files = False,
295295
),

src/test/java/com/google/devtools/build/lib/rules/cpp/proto/CcProtoLibraryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class CcProtoLibraryTest extends BuildViewTestCase {
5151
private final StarlarkAspectClass starlarkCcProtoAspect =
5252
new StarlarkAspectClass(
5353
Label.parseCanonicalUnchecked("@_builtins//:common/cc/cc_proto_library.bzl"),
54-
"_cc_proto_aspect");
54+
"cc_proto_aspect");
5555

5656
@Before
5757
public void setUp() throws Exception {

0 commit comments

Comments
 (0)