Replace platforms from Package manifest with availability guards (#331)

Minimum deployment versions in package manifests can be problematic for
libraries, because changing them or adding them to an existing package
that doesn't already use them forces SemVer breaking majors.

Furthermore, depending on a new library that specifies minimum
deployment targets would force the adopting library to also have to add
these platforms to its manifest (which would in turn force a major).

This PR removes the platforms stanza from the package manifest and
replaces them with availability guards.
This will allow more packages to use swift-crypto, without forcing them
to mint new majors to support the appropriate platforms.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
Gus CairoandCory Benfield authored and GitHub committed 2025-03-04 15:15:32 +00:00
1 parent 7ba43666c5
commit f4c4efd424
126 files changed
+620 -9

No files matched your search

@@ -17,11 +17,13 @@
import Foundation
/// A type that represents a message authentication code.
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public protocol MessageAuthenticationCode: Hashable, ContiguousBytes, CustomStringConvertible, Sequence where Element == UInt8 {
/// The number of bytes in the message authentication code.
var byteCount: Int { get }
}
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
extension MessageAuthenticationCode {
/// Returns a Boolean value indicating whether two message authentication
/// codes are equal.