16 Star 99 Fork 24

Gitee 极速下载/curve

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/opencurve/curve
克隆/下载
common.bzl 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
wuhanqing 提交于 2020-07-24 15:04 . fix compile error in gcc-4.8
# Rule for simple expansion of template files. This performs a simple
# search over the template file for the keys in substitutions,
# and replaces them with the corresponding values.
#
# Typical usage:
# load("/tools/build_rules/template_rule", "expand_header_template")
# template_rule(
# name = "ExpandMyTemplate",
# src = "my.template",
# out = "my.txt",
# substitutions = {
# "$VAR1": "foo",
# "$VAR2": "bar",
# }
# )
#
# Args:
# name: The name of the rule.
# template: The template file to expand
# out: The destination of the expanded file
# substitutions: A dictionary mapping strings to their substitutions
def template_rule_impl(ctx):
ctx.actions.expand_template(
template = ctx.file.src,
output = ctx.outputs.out,
substitutions = ctx.attr.substitutions,
)
template_rule = rule(
attrs = {
"src": attr.label(
mandatory = True,
allow_single_file = True,
),
"substitutions": attr.string_dict(mandatory = True),
"out": attr.output(mandatory = True),
},
# output_to_genfiles is required for header files.
output_to_genfiles = True,
implementation = template_rule_impl,
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/curve.git
[email protected]:mirrors/curve.git
mirrors
curve
curve
master

搜索帮助