diff --git a/tar/unpack/file/rule.bzl b/tar/unpack/file/rule.bzl deleted file mode 100644 index aa95bb8272acd5e87758d9a801a7c4a6679ce277..0000000000000000000000000000000000000000 --- a/tar/unpack/file/rule.bzl +++ /dev/null @@ -1,48 +0,0 @@ -visibility("//tar/...") - -DOC = """unpacks files from a tarball -```py -tar_unpack_file( - - name = "extracted", - src = ":archive.tar", -) -``` -""" - -ATTRS = { - "src": attr.label( - doc = "An archive to extract into a declared directory (`TreeArtifact`).", - mandatory = True, - allow_single_file = [".tar"], - ), -} - -def implementation(ctx): - tar = ctx.toolchains["//tar/toolchain/tar:type"] - - output_dir = ctx.actions.declare_directory(ctx.attr.name) - - args = ctx.actions.args() - args.add("-xvf").add(ctx.file.src.path) - args.add("-C").add(output_dir.path) - - ctx.actions.run( - outputs = [output_dir], - inputs = [ctx.file.src], - arguments = [args], - executable = tar.executable, - tools = [tar.executable], - mnemonic = "TarUnpack", - progress_message = "unpacking %{inputs}", - ) - - depset_files = depset([output_dir]) - return DefaultInfo(files = depset_files) - -tar_unpack_file = rule( - doc = DOC, - attrs = ATTRS, - implementation = implementation, - toolchains = ["//tar/toolchain/tar:type"], -)