Skip to content

Commit d090eef

Browse files
authored
Use deployment target instead of 9999 for min OS version (swiftlang#384)
1 parent 4499edd commit d090eef

31 files changed

+258
-255
lines changed

Package.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import CompilerPluginSupport
66

77
// Availability Macros
88
let availabilityMacros: [SwiftSetting] = [
9-
"FoundationPreview 0.1:macOS 9999, iOS 9999, tvOS 9999, watchOS 9999",
10-
"FoundationPreview 0.2:macOS 9999, iOS 9999, tvOS 9999, watchOS 9999",
11-
"FoundationPreview 0.3:macOS 9999, iOS 9999, tvOS 9999, watchOS 9999",
12-
"FoundationPreview 0.4:macOS 9999, iOS 9999, tvOS 9999, watchOS 9999",
9+
"FoundationPreview 0.1:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4",
10+
"FoundationPredicate 0.1:macOS 14, iOS 17, tvOS 17, watchOS 10",
11+
"FoundationPreview 0.2:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4",
12+
"FoundationPreview 0.3:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4",
13+
"FoundationPredicate 0.3:macOS 14, iOS 17, tvOS 17, watchOS 10",
14+
"FoundationPreview 0.4:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4",
15+
"FoundationPredicate 0.4:macOS 14, iOS 17, tvOS 17, watchOS 10",
1316
].map { .enableExperimentalFeature("AvailabilityMacro=\($0)") }
1417

1518
let package = Package(

Sources/FoundationEssentials/Predicate/Archiving/EncodingContainers+PredicateExpression.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#if FOUNDATION_FRAMEWORK
1414

15-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
15+
@available(FoundationPredicate 0.1, *)
1616
extension KeyedEncodingContainer {
1717
public mutating func encodePredicateExpression<T: PredicateExpression & Encodable, each Input>(_ expression: T, forKey key: Self.Key, variable: repeat PredicateExpressions.Variable<each Input>, predicateConfiguration: PredicateCodableConfiguration) throws where T.Output == Bool {
1818
var container = self.nestedContainer(keyedBy: PredicateExpressionCodingKeys.self, forKey: key)
@@ -25,7 +25,7 @@ extension KeyedEncodingContainer {
2525
}
2626
}
2727

28-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
28+
@available(FoundationPredicate 0.1, *)
2929
extension KeyedDecodingContainer {
3030
public mutating func decodePredicateExpression<each Input>(forKey key: Self.Key, input: repeat (each Input).Type, predicateConfiguration: PredicateCodableConfiguration) throws -> (expression: any PredicateExpression<Bool>, variable: (repeat PredicateExpressions.Variable<each Input>)) {
3131
var container = try self.nestedContainer(keyedBy: PredicateExpressionCodingKeys.self, forKey: key)
@@ -38,7 +38,7 @@ extension KeyedDecodingContainer {
3838
}
3939
}
4040

41-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
41+
@available(FoundationPredicate 0.1, *)
4242
extension UnkeyedEncodingContainer {
4343
public mutating func encodePredicateExpression<T: PredicateExpression & Encodable, each Input>(_ expression: T, variable: repeat PredicateExpressions.Variable<each Input>, predicateConfiguration: PredicateCodableConfiguration) throws where T.Output == Bool {
4444
var container = self.nestedContainer(keyedBy: PredicateExpressionCodingKeys.self)
@@ -54,7 +54,7 @@ extension UnkeyedEncodingContainer {
5454
}
5555
}
5656

57-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
57+
@available(FoundationPredicate 0.1, *)
5858
extension UnkeyedDecodingContainer {
5959
public mutating func decodePredicateExpression<each Input>(input: repeat (each Input).Type, predicateConfiguration: PredicateCodableConfiguration) throws -> (expression: any PredicateExpression<Bool>, variable: (repeat PredicateExpressions.Variable<each Input>)) {
6060
var container = try self.nestedContainer(keyedBy: PredicateExpressionCodingKeys.self)

Sources/FoundationEssentials/Predicate/Archiving/ExpressionArchiving.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@_implementationOnly
1616
import ReflectionInternal
1717

18-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
18+
@available(FoundationPredicate 0.1, *)
1919
enum PredicateCodableError : Error, CustomStringConvertible {
2020
case disallowedType(typeName: String, path: String)
2121
case disallowedIdentifier(String, path: String)
@@ -32,7 +32,7 @@ enum PredicateCodableError : Error, CustomStringConvertible {
3232
}
3333
}
3434

35-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
35+
@available(FoundationPredicate 0.1, *)
3636
private struct ExpressionStructure : Codable {
3737
let identifier: String
3838
let args: [ExpressionStructure]
@@ -115,7 +115,7 @@ private struct ExpressionStructure : Codable {
115115
}
116116
}
117117

118-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
118+
@available(FoundationPredicate 0.1, *)
119119
class PredicateArchivingState {
120120
let configuration: PredicateCodableConfiguration
121121

@@ -136,7 +136,7 @@ class PredicateArchivingState {
136136
}
137137
}
138138

139-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
139+
@available(FoundationPredicate 0.1, *)
140140
extension _ThreadLocal.Key<PredicateArchivingState> {
141141
static let predicateArchivingState = Self<PredicateArchivingState>()
142142
}
@@ -147,7 +147,7 @@ enum PredicateExpressionCodingKeys : CodingKey {
147147
case structure
148148
}
149149

150-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
150+
@available(FoundationPredicate 0.1, *)
151151
fileprivate extension PredicateCodableConfiguration {
152152
mutating func allowInputs<each Input>(_ input: repeat (each Input).Type) {
153153
var inputTypes = [Any.Type]()
@@ -158,7 +158,7 @@ fileprivate extension PredicateCodableConfiguration {
158158
}
159159
}
160160

161-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
161+
@available(FoundationPredicate 0.1, *)
162162
extension KeyedEncodingContainer where Key == PredicateExpressionCodingKeys {
163163
mutating func _encode<T: PredicateExpression & Encodable, each Input>(_ expression: T, variable: repeat PredicateExpressions.Variable<each Input>, predicateConfiguration: PredicateCodableConfiguration) throws where T.Output == Bool {
164164
var predicateConfiguration = predicateConfiguration
@@ -174,7 +174,7 @@ extension KeyedEncodingContainer where Key == PredicateExpressionCodingKeys {
174174
}
175175
}
176176

177-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
177+
@available(FoundationPredicate 0.1, *)
178178
extension KeyedDecodingContainer where Key == PredicateExpressionCodingKeys {
179179
mutating func _decode<each Input>(input: repeat (each Input).Type, predicateConfiguration: PredicateCodableConfiguration) throws -> (expression: any PredicateExpression<Bool>, variable: (repeat PredicateExpressions.Variable<each Input>)) {
180180
var predicateConfiguration = predicateConfiguration

Sources/FoundationEssentials/Predicate/Archiving/Predicate+Codable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#if FOUNDATION_FRAMEWORK
1414

15-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
15+
@available(FoundationPredicate 0.1, *)
1616
extension Predicate : Codable {
1717
public func encode(to encoder: Encoder) throws {
1818
try self.encode(to: encoder, configuration: .standardConfiguration)
@@ -23,7 +23,7 @@ extension Predicate : Codable {
2323
}
2424
}
2525

26-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
26+
@available(FoundationPredicate 0.1, *)
2727
extension Predicate : CodableWithConfiguration {
2828
public typealias EncodingConfiguration = PredicateCodableConfiguration
2929
public typealias DecodingConfiguration = PredicateCodableConfiguration

Sources/FoundationEssentials/Predicate/Archiving/PredicateCodableConfiguration.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
@_implementationOnly
1717
import ReflectionInternal
1818

19-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
19+
@available(FoundationPredicate 0.1, *)
2020
public protocol PredicateCodableKeyPathProviding {
2121
static var predicateCodableKeyPaths : [String : PartialKeyPath<Self>] { get }
2222
}
2323

24-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
24+
@available(FoundationPredicate 0.1, *)
2525
public struct PredicateCodableConfiguration: Sendable, CustomDebugStringConvertible {
2626
enum AllowListType : Equatable, Sendable {
2727
case concrete(Type)
@@ -257,7 +257,7 @@ public struct PredicateCodableConfiguration: Sendable, CustomDebugStringConverti
257257
}
258258
}
259259

260-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
260+
@available(FoundationPredicate 0.1, *)
261261
extension PredicateCodableConfiguration {
262262
func _identifier(for keyPath: AnyKeyPath) -> String? {
263263
let concreteIdentifier = allowedKeyPaths.first {
@@ -331,7 +331,7 @@ extension PredicateCodableConfiguration {
331331
}
332332
}
333333

334-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
334+
@available(FoundationPredicate 0.1, *)
335335
extension PredicateCodableConfiguration {
336336
public static let standardConfiguration: Self = {
337337
var configuration = Self()

Sources/FoundationEssentials/Predicate/Expression.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
13+
@available(FoundationPredicate 0.1, *)
1414
public protocol PredicateExpression<Output> {
1515
associatedtype Output
1616

1717
func evaluate(_ bindings: PredicateBindings) throws -> Output
1818
}
1919

2020
// Only Foundation should add conformances to this protocol
21-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
21+
@available(FoundationPredicate 0.1, *)
2222
public protocol StandardPredicateExpression<Output> : PredicateExpression, Codable, Sendable {}
2323

24-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
24+
@available(FoundationPredicate 0.1, *)
2525
public struct PredicateError: Error, Hashable, CustomDebugStringConvertible {
2626
internal enum _Error: Hashable, Sendable {
2727
case undefinedVariable
@@ -77,7 +77,7 @@ public struct PredicateError: Error, Hashable, CustomDebugStringConvertible {
7777
public static let invalidInput = Self(.invalidInput(nil))
7878
}
7979

80-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
80+
@available(FoundationPredicate 0.1, *)
8181
extension PredicateExpressions {
8282
public struct VariableID: Hashable, Codable, Sendable {
8383
let id: UInt
@@ -166,7 +166,7 @@ extension PredicateExpressions {
166166

167167
}
168168

169-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
169+
@available(FoundationPredicate 0.1, *)
170170
extension PredicateExpressions.KeyPath : Codable where Root : Codable {
171171
private enum CodingKeys : CodingKey {
172172
case root
@@ -203,20 +203,20 @@ extension PredicateExpressions.KeyPath : Codable where Root : Codable {
203203
#endif // FOUNDATION_FRAMEWORK
204204
}
205205
}
206-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
206+
@available(FoundationPredicate 0.1, *)
207207
extension PredicateExpressions.KeyPath : Sendable where Root : Sendable {}
208208

209-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
209+
@available(FoundationPredicate 0.1, *)
210210
extension PredicateExpressions.KeyPath : StandardPredicateExpression where Root : StandardPredicateExpression {}
211211

212-
@available(FoundationPreview 0.3, *)
212+
@available(FoundationPredicate 0.3, *)
213213
extension PredicateExpressions.KeyPath : CustomStringConvertible {
214214
public var description: String {
215215
"KeyPath(root: \(root), keyPath: \(keyPath.debugDescription))"
216216
}
217217
}
218218

219-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
219+
@available(FoundationPredicate 0.1, *)
220220
extension PredicateExpressions.Value : Codable where Output : Codable {
221221
public func encode(to encoder: Encoder) throws {
222222
var container = encoder.singleValueContainer()
@@ -229,13 +229,13 @@ extension PredicateExpressions.Value : Codable where Output : Codable {
229229
}
230230
}
231231

232-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
232+
@available(FoundationPredicate 0.1, *)
233233
extension PredicateExpressions.Value : Sendable where Output : Sendable {}
234234

235-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
235+
@available(FoundationPredicate 0.1, *)
236236
extension PredicateExpressions.Value : StandardPredicateExpression where Output : Codable /*, Output : Sendable*/ {}
237237

238-
@available(FoundationPreview 0.3, *)
238+
@available(FoundationPredicate 0.3, *)
239239
extension PredicateExpressions.Value : CustomStringConvertible {
240240
public var description: String {
241241
var result = "Value<\(_typeName(Output.self))>("
@@ -244,14 +244,14 @@ extension PredicateExpressions.Value : CustomStringConvertible {
244244
}
245245
}
246246

247-
@available(FoundationPreview 0.3, *)
247+
@available(FoundationPredicate 0.3, *)
248248
extension PredicateExpressions.Variable : CustomStringConvertible {
249249
public var description: String {
250250
"Variable(\(key.id))"
251251
}
252252
}
253253

254-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
254+
@available(FoundationPredicate 0.1, *)
255255
extension PredicateExpressions.KeyPath {
256256
public enum CommonKeyPathKind : Hashable, Sendable {
257257
case collectionCount

Sources/FoundationEssentials/Predicate/Expressions/Aggregate.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
13+
@available(FoundationPredicate 0.1, *)
1414
extension PredicateExpressions {
1515
public struct SequenceMaximum<
1616
Elements : PredicateExpression
@@ -36,23 +36,23 @@ extension PredicateExpressions {
3636
}
3737
}
3838

39-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
39+
@available(FoundationPredicate 0.1, *)
4040
extension PredicateExpressions.SequenceMaximum : StandardPredicateExpression where Elements : StandardPredicateExpression {}
4141

42-
@available(FoundationPreview 0.3, *)
42+
@available(FoundationPredicate 0.3, *)
4343
extension PredicateExpressions.SequenceMaximum : CustomStringConvertible {
4444
public var description: String {
4545
"SequenceMaximum(elements: \(elements))"
4646
}
4747
}
4848

49-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
49+
@available(FoundationPredicate 0.1, *)
5050
extension PredicateExpressions.SequenceMaximum : Codable where Elements : Codable {}
5151

52-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
52+
@available(FoundationPredicate 0.1, *)
5353
extension PredicateExpressions.SequenceMaximum : Sendable where Elements : Sendable {}
5454

55-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
55+
@available(FoundationPredicate 0.1, *)
5656
extension PredicateExpressions {
5757
public struct SequenceMinimum<
5858
Elements : PredicateExpression
@@ -78,18 +78,18 @@ extension PredicateExpressions {
7878
}
7979
}
8080

81-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
81+
@available(FoundationPredicate 0.1, *)
8282
extension PredicateExpressions.SequenceMinimum : StandardPredicateExpression where Elements : StandardPredicateExpression {}
8383

84-
@available(FoundationPreview 0.3, *)
84+
@available(FoundationPredicate 0.3, *)
8585
extension PredicateExpressions.SequenceMinimum : CustomStringConvertible {
8686
public var description: String {
8787
"SequenceMinimum(elements: \(elements))"
8888
}
8989
}
9090

91-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
91+
@available(FoundationPredicate 0.1, *)
9292
extension PredicateExpressions.SequenceMinimum : Codable where Elements : Codable {}
9393

94-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
94+
@available(FoundationPredicate 0.1, *)
9595
extension PredicateExpressions.SequenceMinimum : Sendable where Elements : Sendable {}

Sources/FoundationEssentials/Predicate/Expressions/Arithmetic.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
13+
@available(FoundationPredicate 0.1, *)
1414
extension PredicateExpressions {
1515
public enum ArithmeticOperator: Codable, Sendable {
1616
case add, subtract, multiply
@@ -53,17 +53,17 @@ extension PredicateExpressions {
5353
}
5454
}
5555

56-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
56+
@available(FoundationPredicate 0.1, *)
5757
extension PredicateExpressions.Arithmetic : StandardPredicateExpression where LHS : StandardPredicateExpression, RHS : StandardPredicateExpression {}
5858

59-
@available(FoundationPreview 0.3, *)
59+
@available(FoundationPredicate 0.3, *)
6060
extension PredicateExpressions.Arithmetic : CustomStringConvertible {
6161
public var description: String {
6262
"Arithmetic(lhs: \(lhs), operator: \(op), rhs: \(rhs))"
6363
}
6464
}
6565

66-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
66+
@available(FoundationPredicate 0.1, *)
6767
extension PredicateExpressions.Arithmetic : Codable where LHS : Codable, RHS : Codable {
6868
public func encode(to encoder: Encoder) throws {
6969
var container = encoder.unkeyedContainer()
@@ -80,5 +80,5 @@ extension PredicateExpressions.Arithmetic : Codable where LHS : Codable, RHS : C
8080
}
8181
}
8282

83-
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
83+
@available(FoundationPredicate 0.1, *)
8484
extension PredicateExpressions.Arithmetic : Sendable where LHS : Sendable, RHS : Sendable {}

0 commit comments

Comments
 (0)