diff --git a/doc_build/common.md b/doc_build/common.md index d2be5edb..7933de10 100644 --- a/doc_build/common.md +++ b/doc_build/common.md @@ -8,9 +8,9 @@ These attributes are used in several rules within this module. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :-------------: | :-------------: | :------------- | -| out | Name of the output file. This file will always be created and used to access the package content. If `package_file_name` is also specified, `out` will be a symlink. | String | required | | -| package_file_name | The name of the file which will contain the package. The name may contain variables in the forms `{var}` and $(var)`. The values for substitution are specified through `package_variables` or taken from [ctx.var](https://bazel.build/rules/lib/ctx#var). | String | optional | package type specific | -| package_variables | A target that provides `PackageVariablesInfo` to substitute into `package_file_name`. | Label | optional | None | +| out | Name of the output file. This file will always be created and used to access the package content. If `package_file_name` is also specified, `out` will be a symlink. | String | required | | +| package_file_name | The name of the file which will contain the package. The name may contain variables in the forms `{var}` and $(var)`. The values for substitution are specified through `package_variables` or taken from [ctx.var](https://bazel.build/rules/lib/ctx#var). | String | optional | package type specific | +| package_variables | A target that provides `PackageVariablesInfo` to substitute into `package_file_name`. `pkg_zip` and `pkg_tar` also support this in `package_dir` | Label | optional | None | | attributes | Attributes to set on entities created within packages. Not to be confused with bazel rule attributes. See 'Mapping "Attributes"' below | Undefined. | optional | Varies. Consult individual rule documentation for details. | See diff --git a/docs/latest.md b/docs/latest.md index fd92c0a2..6d6e4a55 100755 --- a/docs/latest.md +++ b/docs/latest.md @@ -37,9 +37,9 @@ These attributes are used in several rules within this module. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :-------------: | :-------------: | :------------- | -| out | Name of the output file. This file will always be created and used to access the package content. If `package_file_name` is also specified, `out` will be a symlink. | String | required | | -| package_file_name | The name of the file which will contain the package. The name may contain variables in the forms `{var}` and $(var)`. The values for substitution are specified through `package_variables` or taken from [ctx.var](https://bazel.build/rules/lib/ctx#var). | String | optional | package type specific | -| package_variables | A target that provides `PackageVariablesInfo` to substitute into `package_file_name`. | Label | optional | None | +| out | Name of the output file. This file will always be created and used to access the package content. If `package_file_name` is also specified, `out` will be a symlink. | String | required | | +| package_file_name | The name of the file which will contain the package. The name may contain variables in the forms `{var}` and $(var)`. The values for substitution are specified through `package_variables` or taken from [ctx.var](https://bazel.build/rules/lib/ctx#var). | String | optional | package type specific | +| package_variables | A target that provides `PackageVariablesInfo` to substitute into `package_file_name`. `pkg_zip` and `pkg_tar` also support this in `package_dir` | Label | optional | None | | attributes | Attributes to set on entities created within packages. Not to be confused with bazel rule attributes. See 'Mapping "Attributes"' below | Undefined. | optional | Varies. Consult individual rule documentation for details. | See @@ -126,10 +126,10 @@ pkg_deb(name, archit | homepage | The homepage of the project. | String | optional | "" | | license | The license of the project. | String | optional | "" | | maintainer | The maintainer of the package. | String | required | | -| out | See Common Attributes | Label | required | | +| out | See [Common Attributes](#out) | Label | required | | | package | The name of the package | String | required | | -| package_file_name | See Common Attributes. Default: "{package}-{version}-{architecture}.deb | String | optional | "" | -| package_variables | See Common Attributes | Label | optional | None | +| package_file_name | See [Common Attributes](#package_file_name). Default: "{package}-{version}-{architecture}.deb | String | optional | "" | +| package_variables | See [Common Attributes](#package_variables) | Label | optional | None | | postinst | The post-install script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None | | postrm | The post-remove script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None | | predepends | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] | @@ -290,10 +290,10 @@ pkg_tar(name, build_tar | ownername | - | String | optional | "." | | ownernames | - | Dictionary: String -> String | optional | {} | | owners | - | Dictionary: String -> String | optional | {} | -| package_dir | Prefix to be prepend to all paths written. | String | optional | "" | +| package_dir | Prefix to be prepend to all paths written. The name may contain variables, same as [package_file_name](#package_file_name) | String | optional | "" | | package_dir_file | - | Label | optional | None | -| package_file_name | See Common Attributes | String | optional | "" | -| package_variables | See Common Attributes | Label | optional | None | +| package_file_name | See [Common Attributes](#package_file_name) | String | optional | "" | +| package_variables | See [Common Attributes](#package_variables) | Label | optional | None | | portable_mtime | - | Boolean | optional | True | | private_stamp_detect | - | Boolean | optional | False | | remap_paths | - | Dictionary: String -> String | optional | {} | @@ -313,8 +313,8 @@ Zip archive creation rule and associated logic. ## pkg_zip
-pkg_zip(name, mode, out, package_dir, package_file_name, package_variables,
-             private_stamp_detect, srcs, stamp, strip_prefix, timestamp)
+pkg_zip(name, compression_level, compression_type, mode, out, package_dir, package_file_name,
+             package_variables, private_stamp_detect, srcs, stamp, strip_prefix, timestamp)
 
@@ -325,11 +325,13 @@ pkg_zip(name, mode, name | A unique name for this target. | Name | required | | +| compression_level | The compression level to use, 1 is the fastest, 9 gives the smallest results. 0 skips compression, depending on the method used | Integer | optional | 6 | +| compression_type | The compression to use. Note that lzma and bzip2 might not be supported by all readers. The list of compressions is the same as Python's ZipFile: https://docs.python.org/3/library/zipfile.html#zipfile.ZIP_STORED | String | optional | "deflated" | | mode | The default mode for all files in the archive. | String | optional | "0555" | | out | output file name. Default: name + ".zip". | Label | required | | -| package_dir | The prefix to add to all all paths in the archive. | String | optional | "/" | -| package_file_name | See Common Attributes | String | optional | "" | -| package_variables | See Common Attributes | Label | optional | None | +| package_dir | Prefix to be prepend to all paths written. The name may contain variables, same as [package_file_name](#package_file_name) | String | optional | "/" | +| package_file_name | See [Common Attributes](#package_file_name) | String | optional | "" | +| package_variables | See [Common Attributes](#package_variables) | Label | optional | None | | private_stamp_detect | - | Boolean | optional | False | | srcs | List of files that should be included in the archive. | List of labels | optional | [] | | stamp | Enable file time stamping. Possible values:
  • stamp = 1: Use the time of the build as the modification time of each file in the archive.
  • stamp = 0: Use an "epoch" time for the modification time of each file. This gives good build result caching.
  • stamp = -1: Control the chosen modification time using the --[no]stamp flag. | Integer | optional | 0 | diff --git a/pkg/private/deb/deb.bzl b/pkg/private/deb/deb.bzl index d9b6935b..9083d08b 100644 --- a/pkg/private/deb/deb.bzl +++ b/pkg/private/deb/deb.bzl @@ -341,15 +341,15 @@ See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files.""", # Common attributes "out": attr.output( - doc = """See Common Attributes""", + doc = """See [Common Attributes](#out)""", mandatory = True ), "package_file_name": attr.string( - doc = """See Common Attributes. + doc = """See [Common Attributes](#package_file_name). Default: "{package}-{version}-{architecture}.deb""", ), "package_variables": attr.label( - doc = """See Common Attributes""", + doc = """See [Common Attributes](#package_variables)""", providers = [PackageVariablesInfo], ), diff --git a/pkg/private/tar/tar.bzl b/pkg/private/tar/tar.bzl index 912163b1..379a7010 100644 --- a/pkg/private/tar/tar.bzl +++ b/pkg/private/tar/tar.bzl @@ -253,7 +253,8 @@ pkg_tar_impl = rule( doc = """(note: Use strip_prefix = "." to strip path to the package but preserve relative paths of sub directories beneath the package.)""" ), "package_dir": attr.string( - doc = """Prefix to be prepend to all paths written.""" + doc = """Prefix to be prepend to all paths written. +The name may contain variables, same as [package_file_name](#package_file_name)""", ), "package_dir_file": attr.label(allow_single_file = True), "deps": attr.label_list(allow_files = tar_filetype), @@ -278,9 +279,9 @@ pkg_tar_impl = rule( # Common attributes "out": attr.output(mandatory = True), - "package_file_name": attr.string(doc = "See Common Attributes"), + "package_file_name": attr.string(doc = "See [Common Attributes](#package_file_name)"), "package_variables": attr.label( - doc = "See Common Attributes", + doc = "See [Common Attributes](#package_variables)", providers = [PackageVariablesInfo], ), "stamp": attr.int( diff --git a/pkg/private/zip/zip.bzl b/pkg/private/zip/zip.bzl index 9230de63..eb2d19cb 100644 --- a/pkg/private/zip/zip.bzl +++ b/pkg/private/zip/zip.bzl @@ -103,7 +103,8 @@ pkg_zip_impl = rule( default = "0555", ), "package_dir": attr.string( - doc = """The prefix to add to all all paths in the archive.""", + doc = """Prefix to be prepend to all paths written. +The name may contain variables, same as [package_file_name](#package_file_name)""", default = "/", ), "strip_prefix": attr.string(), @@ -133,9 +134,9 @@ The list of compressions is the same as Python's ZipFile: https://docs.python.or doc = """output file name. Default: name + ".zip".""", mandatory = True, ), - "package_file_name": attr.string(doc = "See Common Attributes"), + "package_file_name": attr.string(doc = "See [Common Attributes](#package_file_name)"), "package_variables": attr.label( - doc = "See Common Attributes", + doc = "See [Common Attributes](#package_variables)", providers = [PackageVariablesInfo], ), "stamp": attr.int(