aboutsummaryrefslogtreecommitdiff
path: root/tests/core/go_library/def.bzl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/go_library/def.bzl')
-rw-r--r--tests/core/go_library/def.bzl22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/core/go_library/def.bzl b/tests/core/go_library/def.bzl
new file mode 100644
index 00000000..613ea84d
--- /dev/null
+++ b/tests/core/go_library/def.bzl
@@ -0,0 +1,22 @@
+def _embedsrcs_files_impl(ctx):
+ name = ctx.attr.name
+ dir = ctx.actions.declare_directory(name)
+ args = [dir.path] + ctx.attr.files
+ ctx.actions.run(
+ outputs = [dir],
+ executable = ctx.executable._gen,
+ arguments = args,
+ )
+ return [DefaultInfo(files = depset([dir]))]
+
+embedsrcs_files = rule(
+ implementation = _embedsrcs_files_impl,
+ attrs = {
+ "files": attr.string_list(),
+ "_gen": attr.label(
+ default = ":gen_embedsrcs_files",
+ executable = True,
+ cfg = "exec",
+ ),
+ },
+)