The rules and macros described below are used to define Gazelle targets to aid in the generation and maintenance of Swift package dependencies.
On this page:
swift_update_packages(name, gazelle, package_manifest, swift_deps, swift_deps_fn, swift_deps_index,
update_bzlmod_use_repo_names, print_bzlmod_stanzas, update_bzlmod_stanzas,
bazel_module, generate_swift_deps_for_workspace, kwargs)
Defines gazelle update-repos targets that are used to resolve and update Swift package dependencies.
PARAMETERS
| Name |
Description |
Default Value |
| name |
The name of the resolve target as a string. The target name for the update target is derived from this value by appending _to_latest. |
none |
| gazelle |
The label to gazelle_binary that includes the rules_swift_package_manager Gazelle extension. |
none |
| package_manifest |
Optional. The name of the Swift package manifest file as a string. |
"Package.swift" |
| swift_deps |
Optional. The name of the Starlark file that should be updated with the Swift package dependencies as a string. |
"swift_deps.bzl" |
| swift_deps_fn |
Optional. The name of the Starlark function in the swift_deps file that should be updated with the Swift package dependencies as a string. |
"swift_dependencies" |
| swift_deps_index |
Optional. The relative path to the Swift dependencies index JSON file. This path is relative to the repository root, not the location of this declaration. |
"swift_deps_index.json" |
| update_bzlmod_use_repo_names |
Optional. Determines whether the Gazelle extension updates the use_repo names to MODULE.bazel. |
False |
| print_bzlmod_stanzas |
Optional. Determines whether the Gazelle extension prints out bzlmod Starlark code that can be pasted into your MODULE.bazel. |
False |
| update_bzlmod_stanzas |
Optional. Determines whether the Gazelle extension adds/updates the bzlmod Starlark code to MODULE.bazel. |
False |
| bazel_module |
Optional. The relative path to the MODULE.bazel file. |
"MODULE.bazel" |
| generate_swift_deps_for_workspace |
Optional. Determines whether to generate the swift dependencies for clients using legacy/WORKSPACE loaded dependencies. |
True |
| kwargs |
Attributes that are passed along to the gazelle declarations. |
none |