mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
20 lines
585 B
Python
20 lines
585 B
Python
def _generate_version_file_impl(ctx):
|
|
out = ctx.actions.declare_file(ctx.attr.output_file)
|
|
ctx.actions.expand_template(
|
|
output = out,
|
|
template = ctx.file.template,
|
|
substitutions = {"${wpilib_version}": "TODO - Built with bazel"},
|
|
)
|
|
return [DefaultInfo(files = depset([out]))]
|
|
|
|
generate_version_file = rule(
|
|
implementation = _generate_version_file_impl,
|
|
attrs = {
|
|
"output_file": attr.string(mandatory = True),
|
|
"template": attr.label(
|
|
allow_single_file = True,
|
|
mandatory = True,
|
|
),
|
|
},
|
|
)
|