"""A macro that can be used for writing files built by Bazel to the source tree.""" def copy_build(name, src_path, out_path): """Copies the contents of the input Bazel label to the source tree at out_path Args: name: The name of the produced rule, and the name this rule will be callable from. src_path: Location or filegroup name of bazel-build directory out_path: Relative path from root of the repository to write the files. """ native.sh_binary( name = name, srcs = ["//pkg/edge/api/graphiql:copy-build.sh"], args = [ "$(location %s)" % src_path, out_path, ], data = [src_path], )