A package collection (SE-0291) is a curated list of packages and associated metadata which makes it easier to discover an existing package for a particular use case. SwiftPM will allow users to subscribe to package collections and make their contents accessible to any clients of libSwiftPM.
This repository provides a set of Swift packages and tooling for the generation and consumption of package collections.
Swift toolchain version 5.4 or greater is required.
The main
branch depends on SwiftPM's main
branch and may be unstable. It is recommended to use versioned branches such as 5.5
, which depend on the corresponding SwiftPM's release/<version>
branch, instead.
Currently, the package collection generator is a standalone tool that's not integrated with the Swift toolchain. To use it from the command line, first build the project from source by cloning the repository and running the following from the root directory:
swift build --configuration release
Then, either run the final executables directly (e.g., .build/release/package-collection-generate
) or install them on your system path:
install .build/release/package-collection-generate /usr/local/bin/package-collection-generate
install .build/release/package-collection-diff /usr/local/bin/package-collection-diff
install .build/release/package-collection-sign /usr/local/bin/package-collection-sign
install .build/release/package-collection-validate /usr/local/bin/package-collection-validate
Finally, another way to run the tool is via swift run
, which builds and runs the specified executable. For example:
swift run package-collection-generate
Package collections can be created and published by anyone. To make sure SwiftPM can consume them, all package collections must adhere to the same format. See the v1 format for details.
package-collection-generate
is a Swift
command-line tool that helps generate package collections.
package-collection-validate
is a Swift
command-line tool that validates package collections against the defined format.
- This should be run against the final output generated by the
package-collection-generate
command.
package-collection-diff
is a Swift
command-line tool that compares two package collections to determine if they are different from each other.