Versioning, Resolving Conflicts and Swift Plugins
Managing version ranges, resolving dependency conflicts and using build tool plugins.
Semantic Versioning in SPM
SPM uses semver: MAJOR.MINOR.PATCH. Declare requirements with from:, exact:, or .upToNextMajor.
.package(url: "https://github.com/apple/swift-log", from: "1.5.0"),
.package(url: "https://github.com/vapor/vapor", exact: "4.83.0"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture",
.upToNextMajor(from: "1.0.0"))Package.resolved
Package.resolved pins exact versions for all dependencies. Commit it for apps; omit it for libraries.
// Package.resolved (auto-generated):
// Pins exact commit hash and version for every dependency
// Run "swift package update" to update pinned versionsAll lessons in this course
- Package.swift: Targets, Products and Dependencies
- Local Packages and Feature Modules
- Binary Targets and XCFrameworks
- Versioning, Resolving Conflicts and Swift Plugins