Skip to content

Commit 1c38456

Browse files
authored
Revert removal of platform requirements (#42)
* Partially revert "f8c70309e75569964669af8a068fb0d0312c323f" * Revert "Remove platform requirements (#37)" This reverts commit fa2eb25.
1 parent 9989a25 commit 1c38456

16 files changed

+62
-869
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
strategy:
1717
matrix:
1818
xcode:
19+
- '12.4'
20+
- '12.5.1'
1921
- '13.0'
2022
- '13.1'
2123
- '13.2.1'

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import PackageDescription
44

55
let package = Package(
66
name: "swift-custom-dump",
7+
platforms: [
8+
.iOS(.v13),
9+
.macOS(.v10_15),
10+
.tvOS(.v13),
11+
.watchOS(.v6),
12+
],
713
products: [
814
.library(
915
name: "CustomDump",

Sources/CustomDump/Conformances/CoreImage.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import CoreImage
33

44
@available(watchOS, unavailable)
5-
@available(iOS 11, macOS 10.13, tvOS 11, *)
65
extension CIQRCodeDescriptor.ErrorCorrectionLevel: CustomDumpStringConvertible {
76
public var customDumpDescription: String {
87
switch self {
@@ -21,8 +20,6 @@
2120
}
2221
}
2322

24-
@available(watchOS, unavailable)
25-
@available(iOS 11, macOS 10.13, tvOS 11, *)
2623
extension CIDataMatrixCodeDescriptor.ECCVersion: CustomDumpStringConvertible {
2724
public var customDumpDescription: String {
2825
switch self {

Sources/CustomDump/Conformances/SwiftUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if canImport(SwiftUI) && DEBUG
1+
#if canImport(SwiftUI)
22
import SwiftUI
33

44
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)

Sources/CustomDump/Conformances/UserNotifications.swift

Lines changed: 30 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,27 @@
2626
var rawValue: UNAuthorizationOptions
2727

2828
var customDumpDescription: String {
29+
switch self.rawValue {
30+
case .alert:
31+
return "UNAuthorizationOptions.alert"
2932
#if os(iOS) || os(watchOS)
30-
if #available(iOS 13, watchOS 6, *), self.rawValue == .announcement {
33+
case .announcement:
3134
return "UNAuthorizationOptions.announcement"
32-
}
3335
#endif
34-
if #available(iOS 12, tvOS 12, watchOS 5, *) {
35-
switch self.rawValue {
36-
case .alert:
37-
return "UNAuthorizationOptions.alert"
38-
case .badge:
39-
return "UNAuthorizationOptions.badge"
40-
case .carPlay:
41-
return "UNAuthorizationOptions.carPlay"
42-
case .criticalAlert:
43-
return "UNAuthorizationOptions.criticalAlert"
44-
case .providesAppNotificationSettings:
45-
return "UNAuthorizationOptions.providesAppNotificationSettings"
46-
case .provisional:
47-
return "UNAuthorizationOptions.provisional"
48-
case .sound:
49-
return "UNAuthorizationOptions.sound"
50-
default:
51-
return "UNAuthorizationOptions(rawValue: \(self.rawValue))"
52-
}
53-
} else {
54-
switch self.rawValue {
55-
case .alert:
56-
return "UNAuthorizationOptions.alert"
57-
case .badge:
58-
return "UNAuthorizationOptions.badge"
59-
case .carPlay:
60-
return "UNAuthorizationOptions.carPlay"
61-
case .sound:
62-
return "UNAuthorizationOptions.sound"
63-
default:
64-
return "UNAuthorizationOptions(rawValue: \(self.rawValue))"
65-
}
36+
case .badge:
37+
return "UNAuthorizationOptions.badge"
38+
case .carPlay:
39+
return "UNAuthorizationOptions.carPlay"
40+
case .criticalAlert:
41+
return "UNAuthorizationOptions.criticalAlert"
42+
case .providesAppNotificationSettings:
43+
return "UNAuthorizationOptions.providesAppNotificationSettings"
44+
case .provisional:
45+
return "UNAuthorizationOptions.provisional"
46+
case .sound:
47+
return "UNAuthorizationOptions.sound"
48+
default:
49+
return "UNAuthorizationOptions(rawValue: \(self.rawValue))"
6650
}
6751
}
6852
}
@@ -72,8 +56,17 @@
7256
var allCases: [UNAuthorizationOptions] = [
7357
.alert
7458
]
75-
self.append_iOS_13_watchOS_6(&allCases)
76-
self.append_iOS_12_tvOS_12_watchOS_5(&allCases)
59+
#if os(iOS) || os(watchOS)
60+
allCases.append(.announcement)
61+
#endif
62+
allCases.append(contentsOf: [
63+
.badge,
64+
.carPlay,
65+
.criticalAlert,
66+
.providesAppNotificationSettings,
67+
.provisional,
68+
.sound,
69+
])
7770
for option in allCases {
7871
if options.contains(option) {
7972
children.append(.init(rawValue: option))
@@ -90,33 +83,6 @@
9083
displayStyle: .set
9184
)
9285
}
93-
94-
// NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.)
95-
//
96-
// defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
97-
private func append_iOS_13_watchOS_6(_ allCases: inout [UNAuthorizationOptions]) {
98-
#if os(iOS) || os(watchOS)
99-
if #available(iOS 13, watchOS 6, *) {
100-
allCases.append(.announcement)
101-
}
102-
#endif
103-
}
104-
105-
// NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.)
106-
//
107-
// defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
108-
private func append_iOS_12_tvOS_12_watchOS_5(_ allCases: inout [UNAuthorizationOptions]) {
109-
if #available(iOS 12, tvOS 12, watchOS 5, *) {
110-
allCases.append(contentsOf: [
111-
.badge,
112-
.carPlay,
113-
.criticalAlert,
114-
.providesAppNotificationSettings,
115-
.provisional,
116-
.sound,
117-
])
118-
}
119-
}
12086
}
12187

12288
@available(iOS 10, macOS 10.14, tvOS 10, watchOS 3, *)
@@ -207,7 +173,7 @@
207173
)
208174
}
209175

210-
// NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.)
176+
// NB: Workaround for Xcode 13.2's new, experimental build system.
211177
//
212178
// defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
213179
private func appendBannerList(_ allCases: inout [UNNotificationPresentationOptions]) {

Sources/CustomDump/Diff.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String
156156
rhsChildren.sort(by: areInIncreasingOrder)
157157
}
158158

159-
let difference = rhsChildren._difference(from: lhsChildren, by: areEquivalent)
159+
let difference = rhsChildren.difference(from: lhsChildren, by: areEquivalent)
160160

161161
var lhsOffset = 0
162162
var rhsOffset = 0

Sources/CustomDump/Internal/CollectionDifference.Change.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)