File: export_header.bzl

package info (click to toggle)
prometheus-cpp 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 792 kB
  • sloc: cpp: 3,596; sh: 37; makefile: 12
file content (21 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def _generate_dummy_export_header_impl(ctx):
    ctx.actions.expand_template(
        template = ctx.file._template,
        output = ctx.outputs.header_file,
        substitutions = {
            "{BASE_NAME}": ctx.attr.basename,
        },
    )

generate_dummy_export_header = rule(
    attrs = {
        "basename": attr.string(mandatory = True),
        "header": attr.string(mandatory = True),
        "_template": attr.label(
            allow_single_file = True,
            default = Label("@com_github_jupp0r_prometheus_cpp//bazel:dummy_export.h.tpl"),
        ),
    },
    implementation = _generate_dummy_export_header_impl,
    outputs = {"header_file": "%{header}"},
)