Swift Package Manager Manifest API Redesign

The Package Manager in Swift 4 includes the redesigned Package.swift manifest API. The new API is easier to use and follows the design guidelines. The target inference rules in Swift 3 Package Manager were a common source of confusion. We revised these rules and removed most of the inference, favoring the practice of explicitly specifying package structure in the manifest.

swift.org/blog/swift-package-manager-manifest-api-redesign/

Swift 4 redesigned the Package.swift manifest API in the Package Manager to make it simpler and match the design rules. It changed the target inference rules from Swift 3, which often confused users, and now asks developers to state the package structure clearly.

Swift 3 packages still run in Swift 4 because the manager stays backwards compatible, and the tools version in the manifest picks the right format. The tools version also sets the default Swift language version for compiling sources, but you can change it with the swiftLanguageVersions property to keep old code working.

To update a package, set the tools version, move dependencies, declare all targets, export public ones as products, and compile in Swift 3 mode if needed.


Category:

Tag:

Year: