2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-11-27 17:43:27 +00:00
bazel-lib/e2e/write_source_files/test_extension.bzl
2023-09-22 13:04:09 -07:00

21 lines
458 B
Python

"Test module extension to create a test repository"
def _test_repo_impl(rctx):
rctx.file("BUILD.bazel", """\
exports_files(["foobar.txt"], visibility = ["//visibility:public"])
""", executable = False)
rctx.file("foobar.txt", "foobar\n")
test_repo = repository_rule(
local = True,
implementation = _test_repo_impl,
)
def _test_ext_impl(_):
test_repo(name = "test")
test_ext = module_extension(
implementation = _test_ext_impl,
)