Skip to content

Commit 5f5be41

Browse files
Restore the doc of package(name:exact:) to sync with its actual semantics (#4269)
It seems the doc comment was unintentionally taken from `package(name:from:)`. This happend in 8dd0202
1 parent 03df3ac commit 5f5be41

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Sources/PackageDescription/PackageDependency.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -412,20 +412,18 @@ extension Package.Dependency {
412412

413413
/// Adds a package dependency that uses the exact version requirement.
414414
///
415-
/// This is the recommended way to specify a remote package dependency.
416-
/// It allows you to specify the minimum version you require, allows updates that include bug fixes
417-
/// and backward-compatible feature updates, but requires you to explicitly update to a new major version of the dependency.
418-
/// This approach provides the maximum flexibility on which version to use,
419-
/// while making sure you don't update to a version with breaking changes,
420-
/// and helps to prevent conflicts in your dependency graph.
415+
/// Specifying exact version requirements are not recommended as
416+
/// they can cause conflicts in your dependency graph when multiple other packages depend on a package.
417+
/// As Swift packages follow the semantic versioning convention,
418+
/// think about specifying a version range instead.
421419
///
422420
/// The following example instruct the Swift Package Manager to use version `1.2.3`.
423421
///
424422
/// .package(url: "https://example.com/example-package.git", exact: "1.2.3"),
425423
///
426424
/// - Parameters:
427425
/// - url: The valid Git URL of the package.
428-
/// - version: The minimum version requirement.
426+
/// - version: The exact version of the dependency for this requirement.
429427
@available(_PackageDescription, introduced: 5.6)
430428
public static func package(
431429
url: String,
@@ -505,20 +503,18 @@ extension Package.Dependency {
505503

506504
/// Adds a package dependency that uses the exact version requirement.
507505
///
508-
/// This is the recommended way to specify a remote package dependency.
509-
/// It allows you to specify the minimum version you require, allows updates that include bug fixes
510-
/// and backward-compatible feature updates, but requires you to explicitly update to a new major version of the dependency.
511-
/// This approach provides the maximum flexibility on which version to use,
512-
/// while making sure you don't update to a version with breaking changes,
513-
/// and helps to prevent conflicts in your dependency graph.
506+
/// Specifying exact version requirements are not recommended as
507+
/// they can cause conflicts in your dependency graph when multiple other packages depend on a package.
508+
/// As Swift packages follow the semantic versioning convention,
509+
/// think about specifying a version range instead.
514510
///
515511
/// The following example instruct the Swift Package Manager to use version `1.2.3`.
516512
///
517513
/// .package(id: "scope.name", exact: "1.2.3"),
518514
///
519515
/// - Parameters:
520516
/// - id: The identity of the package.
521-
/// - version: The minimum version requirement.
517+
/// - version: The exact version of the dependency for this requirement.
522518
@available(_PackageDescription, introduced: 5.7)
523519
public static func package(
524520
id: String,

0 commit comments

Comments
 (0)