0Pricing
Swift Academy · Lesson

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 versions

All lessons in this course

  1. Package.swift: Targets, Products and Dependencies
  2. Local Packages and Feature Modules
  3. Binary Targets and XCFrameworks
  4. Versioning, Resolving Conflicts and Swift Plugins
← Back to Swift Academy