我的项目取决于一些我必须自己做好准备的外部库。因此,我的WORKSPACE
:
http_archive(
name = "external_lib_component1",
build_file = "//third_party:external_lib_component1.BUILD",
sha256 = "xxx",
urls = ["https://example.org/external_lib_component1.tar.gz"],
)
http_archive(
name = "external_lib_component2",
build_file = "//third_party:external_lib_component2.BUILD",
sha256 = "yyy",
urls = ["https://example.org/external_lib_component2.tar.gz"],
)
...
上面的两个条目相似,并且external_lib_component{1, 2}.BUILD
共享许多代码。在它们之间共享代码(宏)的最佳方法是什么?
仅将shared_macros.bzl
文件放入third_party/
将不起作用,因为它不会被复制到建立时的存档位置(仅复制build_file
。)>
我的项目取决于一些我必须自己做好准备的外部库。因此,我的工作空间:http_archive(name =“ external_lib_component1”,build_file =“ // third_party:...
如果您将bzl
这样的./third_party/shared_macros.bzl
文件放入您提到的树中,则为您。