|
| 1 | +<!-- Generated with Stardoc, Do Not Edit! --> |
| 2 | +# Bazel Modules (bzlmod) Extensions |
| 3 | + |
| 4 | + |
| 5 | +The bzlmod extensions described below are used by `rules_swift_package_manager` to customize the build of the external Swift packages. |
| 6 | + |
| 7 | +On this page: |
| 8 | + |
| 9 | + * [swift_deps](#swift_deps) |
| 10 | + |
| 11 | + |
| 12 | +<a id="swift_deps"></a> |
| 13 | + |
| 14 | +## swift_deps |
| 15 | + |
| 16 | +<pre> |
| 17 | +swift_deps = use_extension("@rules_swift_package_manager//:extensions.bzl", "swift_deps") |
| 18 | +swift_deps.configure_package(<a href="#swift_deps.configure_package-name">name</a>, <a href="#swift_deps.configure_package-init_submodules">init_submodules</a>, <a href="#swift_deps.configure_package-patch_args">patch_args</a>, <a href="#swift_deps.configure_package-patch_cmds">patch_cmds</a>, <a href="#swift_deps.configure_package-patch_cmds_win">patch_cmds_win</a>, |
| 19 | + <a href="#swift_deps.configure_package-patch_tool">patch_tool</a>, <a href="#swift_deps.configure_package-patches">patches</a>, <a href="#swift_deps.configure_package-recursive_init_submodules">recursive_init_submodules</a>) |
| 20 | +swift_deps.from_package(<a href="#swift_deps.from_package-declare_swift_deps_info">declare_swift_deps_info</a>, <a href="#swift_deps.from_package-resolved">resolved</a>, <a href="#swift_deps.from_package-swift">swift</a>) |
| 21 | +</pre> |
| 22 | + |
| 23 | + |
| 24 | +**TAG CLASSES** |
| 25 | + |
| 26 | +<a id="swift_deps.configure_package"></a> |
| 27 | + |
| 28 | +### configure_package |
| 29 | + |
| 30 | +Used to add or override settings for a particular Swift package. |
| 31 | + |
| 32 | +**Attributes** |
| 33 | + |
| 34 | +| Name | Description | Type | Mandatory | Default | |
| 35 | +| :------------- | :------------- | :------------- | :------------- | :------------- | |
| 36 | +| <a id="swift_deps.configure_package-name"></a>name | The identity (i.e., name in the package's manifest) for the Swift package. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | | |
| 37 | +| <a id="swift_deps.configure_package-init_submodules"></a>init_submodules | Whether to clone submodules in the repository. | Boolean | optional | `False` | |
| 38 | +| <a id="swift_deps.configure_package-patch_args"></a>patch_args | The arguments given to the patch tool. Defaults to -p0, however -p1 will usually be needed for patches generated by git. If multiple -p arguments are specified, the last one will take effect.If arguments other than -p are specified, Bazel will fall back to use patch command line tool instead of the Bazel-native patch implementation. When falling back to patch command line tool and patch_tool attribute is not specified, `patch` will be used. | List of strings | optional | `["-p0"]` | |
| 39 | +| <a id="swift_deps.configure_package-patch_cmds"></a>patch_cmds | Sequence of Bash commands to be applied on Linux/Macos after patches are applied. | List of strings | optional | `[]` | |
| 40 | +| <a id="swift_deps.configure_package-patch_cmds_win"></a>patch_cmds_win | Sequence of Powershell commands to be applied on Windows after patches are applied. If this attribute is not set, patch_cmds will be executed on Windows, which requires Bash binary to exist. | List of strings | optional | `[]` | |
| 41 | +| <a id="swift_deps.configure_package-patch_tool"></a>patch_tool | The patch(1) utility to use. If this is specified, Bazel will use the specified patch tool instead of the Bazel-native patch implementation. | String | optional | `""` | |
| 42 | +| <a id="swift_deps.configure_package-patches"></a>patches | A list of files that are to be applied as patches after extracting the archive. By default, it uses the Bazel-native patch implementation which doesn't support fuzz match and binary patch, but Bazel will fall back to use patch command line tool if `patch_tool` attribute is specified or there are arguments other than `-p` in `patch_args` attribute. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` | |
| 43 | +| <a id="swift_deps.configure_package-recursive_init_submodules"></a>recursive_init_submodules | Whether to clone submodules recursively in the repository. | Boolean | optional | `True` | |
| 44 | + |
| 45 | +<a id="swift_deps.from_package"></a> |
| 46 | + |
| 47 | +### from_package |
| 48 | + |
| 49 | +Load Swift packages from `Package.swift` and `Package.resolved` files. |
| 50 | + |
| 51 | +**Attributes** |
| 52 | + |
| 53 | +| Name | Description | Type | Mandatory | Default | |
| 54 | +| :------------- | :------------- | :------------- | :------------- | :------------- | |
| 55 | +| <a id="swift_deps.from_package-declare_swift_deps_info"></a>declare_swift_deps_info | Declare a `swift_deps_info` repository that is used by external tooling (e.g. Swift Gazelle plugin). | Boolean | optional | `False` | |
| 56 | +| <a id="swift_deps.from_package-resolved"></a>resolved | A `Package.resolved`. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` | |
| 57 | +| <a id="swift_deps.from_package-swift"></a>swift | A `Package.swift`. | <a href="https://bazel.build/concepts/labels">Label</a> | required | | |
| 58 | + |
| 59 | + |
0 commit comments