Skip to content

Commit a849353

Browse files
authored
Drop support for older Apple releases. (#1533)
This PR drops support for older Apple releases when Swift Testing is built as a package. See Also: swiftlang/swift#87042 ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent dbfaf0c commit a849353

38 files changed

Lines changed: 34 additions & 223 deletions

Package.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ let package = Package(
4242
platforms: {
4343
if !buildingForEmbedded {
4444
[
45-
.macOS(.v10_15),
46-
.iOS(.v13),
47-
.watchOS(.v6),
48-
.tvOS(.v13),
49-
.macCatalyst(.v13),
45+
.macOS(.v14),
46+
.iOS(.v17),
47+
.watchOS(.v10),
48+
.tvOS(.v17),
49+
.macCatalyst(.v17),
5050
.visionOS(.v1),
5151
]
5252
} else {
@@ -423,12 +423,8 @@ extension Array where Element == PackageDescription.SwiftSetting {
423423
/// [swift#65218](https://github.com/swiftlang/swift/pull/65218).
424424
private static var availabilityMacroSettings: Self {
425425
[
426-
.enableExperimentalFeature("AvailabilityMacro=_mangledTypeNameAPI:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0"),
427426
.enableExperimentalFeature("AvailabilityMacro=_uttypesAPI:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0"),
428-
.enableExperimentalFeature("AvailabilityMacro=_backtraceAsyncAPI:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0"),
429427
.enableExperimentalFeature("AvailabilityMacro=_clockAPI:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0"),
430-
.enableExperimentalFeature("AvailabilityMacro=_regexAPI:macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0"),
431-
.enableExperimentalFeature("AvailabilityMacro=_swiftVersionAPI:macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0"),
432428
.enableExperimentalFeature("AvailabilityMacro=_typedThrowsAPI:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"),
433429
.enableExperimentalFeature("AvailabilityMacro=_castingWithNonCopyableGenerics:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"),
434430

Sources/Overlays/_Testing_AppKit/Attachments/NSImage+AttachableAsImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extension NSImageRep {
3636
/// @Metadata {
3737
/// @Available(Swift, introduced: 6.3)
3838
/// }
39-
@available(_uttypesAPI, *)
39+
@available(_uttypesAPI, *) // For DocC
4040
extension NSImage: AttachableAsImage, AttachableAsCGImage {
4141
/// @Metadata {
4242
/// @Available(Swift, introduced: 6.3)

Sources/Overlays/_Testing_CoreGraphics/Attachments/AttachableAsCGImage.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ private import UniformTypeIdentifiers
2222
///
2323
/// This protocol is not part of the public interface of the testing library. It
2424
/// encapsulates Apple-specific logic for image attachments.
25-
@available(_uttypesAPI, *)
2625
package protocol AttachableAsCGImage: AttachableAsImage {
2726
/// An instance of `CGImage` representing this image.
2827
///
@@ -51,11 +50,9 @@ package protocol AttachableAsCGImage: AttachableAsImage {
5150
}
5251

5352
/// All type identifiers supported by Image I/O.
54-
@available(_uttypesAPI, *)
5553
private let _supportedTypeIdentifiers = Set(CGImageDestinationCopyTypeIdentifiers() as? [String] ?? [])
5654

5755
/// All content types supported by Image I/O.
58-
@available(_uttypesAPI, *)
5956
private let _supportedContentTypes = {
6057
#if canImport(UniformTypeIdentifiers_Private)
6158
UTType._types(identifiers: _supportedTypeIdentifiers).values
@@ -64,7 +61,6 @@ private let _supportedContentTypes = {
6461
#endif
6562
}()
6663

67-
@available(_uttypesAPI, *)
6864
extension AttachableAsCGImage {
6965
package var attachmentOrientation: CGImagePropertyOrientation {
7066
.up

Sources/Overlays/_Testing_CoreGraphics/Attachments/AttachableImageFormat+UTType.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public import UniformTypeIdentifiers
1414
/// @Metadata {
1515
/// @Available(Swift, introduced: 6.3)
1616
/// }
17-
@available(_uttypesAPI, *)
17+
@available(_uttypesAPI, *) // For DocC
1818
extension AttachableImageFormat {
1919
/// The content type corresponding to this image format.
2020
///
@@ -101,7 +101,6 @@ extension AttachableImageFormat {
101101

102102
// MARK: - CustomStringConvertible, CustomDebugStringConvertible
103103

104-
@available(_uttypesAPI, *)
105104
extension AttachableImageFormat.Kind: CustomStringConvertible, CustomDebugStringConvertible {
106105
/// The content type corresponding to this image format.
107106
fileprivate var contentType: UTType {

Sources/Overlays/_Testing_CoreGraphics/Attachments/CGImage+AttachableAsImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public import CoreGraphics
1414
/// @Metadata {
1515
/// @Available(Swift, introduced: 6.3)
1616
/// }
17-
@available(_uttypesAPI, *)
17+
@available(_uttypesAPI, *) // For DocC
1818
extension CGImage: AttachableAsImage, AttachableAsCGImage {
1919
/// @Metadata {
2020
/// @Available(Swift, introduced: 6.3)

Sources/Overlays/_Testing_CoreGraphics/Attachments/_AttachableImageWrapper+AttachableWrapper.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ private import UniformTypeIdentifiers
1616
/// @Metadata {
1717
/// @Available(Swift, introduced: 6.3)
1818
/// }
19-
@available(_uttypesAPI, *)
2019
extension _AttachableImageWrapper: Attachable, AttachableWrapper where Image: AttachableAsImage {
2120
/// Get the image format to use when encoding an image, substituting a
2221
/// concrete type for `UTType.image` in particular.

Sources/Overlays/_Testing_CoreImage/Attachments/CIImage+AttachableAsImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public import _Testing_CoreGraphics
1515
/// @Metadata {
1616
/// @Available(Swift, introduced: 6.3)
1717
/// }
18-
@available(_uttypesAPI, *)
18+
@available(_uttypesAPI, *) // For DocC
1919
extension CIImage: AttachableAsImage, AttachableAsCGImage {
2020
/// @Metadata {
2121
/// @Available(Swift, introduced: 6.3)

Sources/Overlays/_Testing_UIKit/Attachments/UIImage+AttachableAsImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private import UIKitCore_Private
2020
/// @Metadata {
2121
/// @Available(Swift, introduced: 6.3)
2222
/// }
23-
@available(_uttypesAPI, *)
23+
@available(_uttypesAPI, *) // For DocC
2424
extension UIImage: AttachableAsImage, AttachableAsCGImage {
2525
/// @Metadata {
2626
/// @Available(Swift, introduced: 6.3)

Sources/Overlays/_Testing_WinSDK/Attachments/AttachableAsIWICBitmapSource.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ extension AttachableAsIWICBitmapSource {
104104
/// used by types that conform to ``AttachableAsIWICBitmapSource``.
105105
///
106106
/// For documentation, see ``AttachableAsImage/withUnsafeBytes(as:_:)``.
107-
public func withUnsafeBytesImpl<R>(as imageFormat: AttachableImageFormat, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
107+
func withUnsafeBytesImpl<R>(as imageFormat: AttachableImageFormat, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
108108
// Create an in-memory stream to write the image data to. Note that Windows
109109
// documentation recommends SHCreateMemStream() instead, but that function
110110
// does not provide a mechanism to access the underlying memory directly.

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,6 @@ public func configurationForEntryPoint(from args: __CommandLineArguments_v0) thr
629629
return .unfiltered
630630
}
631631

632-
guard #available(_regexAPI, *) else {
633-
throw _EntryPointError.featureUnavailable("The `\(label)' option is not supported on this OS version.")
634-
}
635632
return try Configuration.TestFilter(membership: membership, matchingAnyOf: regexes)
636633
}
637634
filters.append(try testFilter(forRegularExpressions: args.filter, label: "--filter", membership: .including))

0 commit comments

Comments
 (0)