rules_archiving
is a Bazel rule for building tarballs, with more flexibility than pkg_tar
In your WORKSPACE
:
git_repository(
name = "hchauvin_rules_archiving",
remote = "https://github.com/hchauvin/rules_archiving.git",
commit = "{HEAD}",
)
Then in a BUILD
file:
load("@hchauvin_rules_archiving//:defs.bzl", "tar_archive")
tar_archive(
name = "archive",
srcs_rename = {
"//:from.txt": "to.txt",
},
# ...
)
tar_archive(srcs_rename, srcs, extension, deps_append, deps_prefixed)
Rule to produce a tarball from a set of files and tarballs. It offers some
flexibility concerning how the files are laid out. Among other things, it
allows the renaming of files, which might be in some cases more suitable than
symlinking, and can be used to avoid using multiple layers of pkg_tar
to
get to the desired layout.
Attributes | |
---|---|
srcs_rename |
Dictionary of single files to strings. They are added to the tarball under the path given by the strings. The labels can be outside the package invoking the rule. |
srcs |
The files must be within the package invoking the rule, and the paths in the tarball are relative to the package. |
extension |
Extension of the resulting tarball. Can also be |
deps_append |
Tarballs ( |
deps_prefixed |
Tarballs ( |