swift.star¶
Bump Swift Package Manager dependencies and the swift-tools-version.
Edits are line-based, so comments and layout in Package.swift stay as
they were. Package.resolved isn't updated; run swift package update
<name> in a run step when it is committed.
| Function | What it does |
|---|---|
manifests |
Lists the repo's Package.swift files. |
set_package |
Sets the version of a package dependency wherever a manifest declares it. |
set_tools_version |
Raises the // swift-tools-version: line, never lowering it. |
manifests¶
Lists the repo's Package.swift files.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of every Package.swift outside .build directories.
Example
set_package¶
Sets the version of a package dependency wherever a manifest declares it.
A newer version already there is kept, so a campaign never lowers one.
Covers from:, exact:, .upToNextMajor(from:) and
.upToNextMinor(from:) requirements; the kind of requirement stays.
Packages pinned to a branch or revision are left alone. The URL matches
with or without a trailing .git.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
url |
The package URL, such as https://github.com/apple/swift-log. |
version |
The new version. |
Returns: The list of paths that changed.
Example
Package.swift
Used in: swift-package-bump
set_tools_version¶
Raises the // swift-tools-version: line, never lowering it.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
version |
The Swift tools version, such as 5.10. |
Returns: The list of paths that changed.
Example
Used in: swift-package-bump