Bazel中的CC_PROTO_LIBRARY`实现在哪里?
我读了 bazel 的源代码 > cc_library 在 src/main/starlark/incoreins_bzl/common/common/cc
中。
另外,我在 src/main/starlark/nelidins_bzl/common/proto 中找到了
proto_library
。但是我找不到 cc_proto_library
的实现在哪里。
谁能告诉我它是如何工作的?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提示:在
您可以使用查询快速找到任何内置规则的实现:
这将使您带入 ccprotolibraryrule.java 定义:
实现是用
.factoryClass(ccprotolibrary.class)
。对于您问题的第二部分,“内置”是Bazel内部概念,可以透明地将Java实现Bazel规则换成其starlark等效,而无需在构建中添加任何
load> load
语句文件。这对于将现有用户迁移到恒星实现而不会引起用户影响是必要的。Tip: use the Bazel codesearch at https://source.bazel.build to navigate its source code.
You can quickly find the implementation of any built-in rule using a query like:
This will bring you to the CcProtoLibraryRule.java definition:
The implementation is defined with
.factoryClass(CcProtoLibrary.class)
.For the second part of your question, "builtins" are a Bazel-internal concept to transparently swap out the Java implementation of a Bazel rule to its Starlark equivalent, without needing to add any
load
statements in the BUILD file. This is necessary to migrate existing users to Starlark implementations without causing user impact.