Skip to content

Commit f8c7030

Browse files
authored
Run 13.2 CI on experimental build system (#38)
* Run 13.2 CI on experimental build system * wip * wip * wip
1 parent e9205f1 commit f8c7030

File tree

2 files changed

+37
-16
lines changed

2 files changed

+37
-16
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ jobs:
1919
- '13.0'
2020
- '13.1'
2121
- '13.2.1'
22+
experimental-build-system: [false]
23+
include:
24+
- xcode: '13.2.1'
25+
experimental-build-system: true
2226
steps:
2327
- uses: actions/checkout@v2
2428
- name: Select Xcode ${{ matrix.xcode }}
2529
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
30+
- name: Enable Experimental Build System
31+
if: ${{ matrix.experimental-build-system }}
32+
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
2633
- name: Print Swift version
2734
run: swift --version
2835
- name: Run tests (Swift)

Sources/CustomDump/Conformances/UserNotifications.swift

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,8 @@
7272
var allCases: [UNAuthorizationOptions] = [
7373
.alert
7474
]
75-
#if os(iOS) || os(watchOS)
76-
if #available(iOS 13, watchOS 6, *) {
77-
allCases.append(.announcement)
78-
}
79-
#endif
80-
if #available(iOS 12, tvOS 12, watchOS 5, *) {
81-
allCases.append(contentsOf: [
82-
.badge,
83-
.carPlay,
84-
.criticalAlert,
85-
.providesAppNotificationSettings,
86-
.provisional,
87-
.sound,
88-
])
89-
}
75+
self.append_iOS_13_watchOS_6(&allCases)
76+
self.append_iOS_12_tvOS_12_watchOS_5(&allCases)
9077
for option in allCases {
9178
if options.contains(option) {
9279
children.append(.init(rawValue: option))
@@ -103,6 +90,33 @@
10390
displayStyle: .set
10491
)
10592
}
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+
}
106120
}
107121

108122
@available(iOS 10, macOS 10.14, tvOS 10, watchOS 3, *)
@@ -193,7 +207,7 @@
193207
)
194208
}
195209

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

0 commit comments

Comments
 (0)