2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-27 02:43:28 +00:00
rules_foreign_cc/test/shell_script_helper_test_rule.bzl
UebelAndre 14520d220f
Made buildifier checks more aggressive (#485)
* Made buildifier checks more aggressive

* Ran buildifier to fix all warnings

* Added sorting to cmake script generation and updated tests
2021-02-02 20:09:33 +00:00

26 lines
690 B
Python

# buildifier: disable=module-docstring
load(
"@rules_foreign_cc//tools/build_defs:shell_script_helper.bzl",
"convert_shell_script",
)
def _impl(ctx):
text = convert_shell_script(ctx, ctx.attr.script)
out = ctx.actions.declare_file(ctx.attr.out)
ctx.actions.write(
output = out,
content = text,
)
return [DefaultInfo(files = depset([out]))]
shell_script_helper_test_rule = rule(
implementation = _impl,
attrs = {
"out": attr.string(mandatory = True),
"script": attr.string_list(mandatory = True),
},
toolchains = [
"@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:shell_commands",
],
)