talira

Swift Package Manager

Organize, manage, and edit Swift packages

open sourceApache-2.0 WITH Swift-exceptionself-hostablefree

Swift Package Manager (SwiftPM) is the package manager and build tool that comes with Swift. A Package.swift manifest declares a package's targets, products and dependencies, which SwiftPM resolves (from Git repositories or a package registry), fetches, compiles and links; swift build, swift test and swift run build, test and run the code on macOS and Linux. It handles versioning, resources, C language targets and module maps, build plugins and command plugins, package collections and SBOM generation, and since Xcode 11 Xcode uses it to add packages to iOS, macOS, watchOS and tvOS apps. SourceKit-LSP builds on it as a library for editors. It ships in every Swift toolchain and is Apache-2.0 licensed.

Problems it solves

  • add a third-party Swift library to my iOS or macOS app
  • share my Swift code as a package other projects can depend on
  • build and test a Swift project from the command line on Linux
  • pin and update the versions of my Swift dependencies
  • run code generation or linting as part of a Swift package build with a plugin
  • host private Swift packages in a package registry for my team
  • generate an SBOM for a Swift package

Features

  • Package.swift manifest for targets, products and dependencies
  • dependency resolution from Git repositories and package registries
  • swift build, swift test and swift run commands
  • resources, C language targets, module maps and module aliasing
  • build tool and command plugins
  • package collections
  • SBOM generation
  • registry server specification for hosting packages
  • integrated with Xcode since Xcode 11
  • usable as a library (libSwiftPM), as SourceKit-LSP does

Capabilities

Has a command line toolplan not known
Takes pluginsplan not known