1 def _generate_dummy_export_header_impl(ctx):
2 ctx.actions.expand_template(
3 template = ctx.file._template,
4 output = ctx.outputs.header_file,
6 "{BASE_NAME}": ctx.attr.basename,
10 generate_dummy_export_header = rule(
12 "basename": attr.string(mandatory = True),
13 "header": attr.string(mandatory = True),
14 "_template": attr.label(
15 allow_single_file = True,
16 default = Label("@com_github_jupp0r_prometheus_cpp//bazel:dummy_export.h.tpl"),
19 implementation = _generate_dummy_export_header_impl,
20 outputs = {"header_file": "%{header}"},