Skip to content

Commit 9b5a4e4

Browse files
authored
Lowered minimum deployment versions for iOS and Mac Catalyst to allow launch on iOS versions 15 and 16 (#782)
1 parent a0daa35 commit 9b5a4e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+125
-49
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let swiftSettings: [SwiftSetting] = [
1717

1818
let package = Package(
1919
name: "hummingbird",
20-
platforms: [.macOS(.v14), .iOS(.v17), .macCatalyst(.v17), .tvOS(.v17), .visionOS(.v1)],
20+
platforms: [.macOS(.v11), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v15), .visionOS(.v1)],
2121
products: [
2222
.library(name: "Hummingbird", targets: ["Hummingbird"]),
2323
.library(name: "HummingbirdCore", targets: ["HummingbirdCore"]),

Package@swift-6.0.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let swiftSettings: [SwiftSetting] = [
1717

1818
let package = Package(
1919
name: "hummingbird",
20-
platforms: [.macOS(.v14), .iOS(.v17), .macCatalyst(.v17), .tvOS(.v17), .visionOS(.v1)],
20+
platforms: [.macOS(.v11), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v15), .visionOS(.v1)],
2121
products: [
2222
.library(name: "Hummingbird", targets: ["Hummingbird"]),
2323
.library(name: "HummingbirdCore", targets: ["HummingbirdCore"]),

Package@swift-6.1.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let swiftSettings: [SwiftSetting] = [
1717

1818
let package = Package(
1919
name: "hummingbird",
20-
platforms: [.macOS(.v14), .iOS(.v17), .macCatalyst(.v17), .tvOS(.v17), .visionOS(.v1)],
20+
platforms: [.macOS(.v11), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v15), .visionOS(.v1)],
2121
products: [
2222
.library(name: "Hummingbird", targets: ["Hummingbird"]),
2323
.library(name: "HummingbirdCore", targets: ["HummingbirdCore"]),

Sources/Hummingbird/Application.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public enum EventLoopGroupProvider {
4141
}
4242

4343
/// Protocol for an Application. Brings all the components of Hummingbird together
44+
@available(macOS 14, iOS 17, tvOS 17, *)
4445
public protocol ApplicationProtocol: Service where Context: InitializableFromSource<ApplicationRequestContextSource> {
4546
/// Responder that generates a response from a requests and context
4647
associatedtype Responder: HTTPResponder
@@ -67,11 +68,13 @@ public protocol ApplicationProtocol: Service where Context: InitializableFromSou
6768
var processesRunBeforeServerStart: [@Sendable () async throws -> Void] { get }
6869
}
6970

71+
@available(macOS 14, iOS 17, tvOS 17, *)
7072
extension ApplicationProtocol {
7173
/// Server channel setup
7274
public var server: HTTPServerBuilder { .http1() }
7375
}
7476

77+
@available(macOS 14, iOS 17, tvOS 17, *)
7578
extension ApplicationProtocol {
7679
/// Default event loop group used by application
7780
public var eventLoopGroup: any EventLoopGroup { MultiThreadedEventLoopGroup.singleton }
@@ -88,6 +91,7 @@ extension ApplicationProtocol {
8891
}
8992

9093
/// Conform to `Service` from `ServiceLifecycle`.
94+
@available(macOS 14, iOS 17, tvOS 17, *)
9195
extension ApplicationProtocol {
9296
/// Construct application and run it
9397
public func run() async throws {
@@ -175,6 +179,7 @@ extension ApplicationProtocol {
175179
/// try await app.runService()
176180
/// ```
177181
/// Editing the application setup after calling `runService` will produce undefined behaviour.
182+
@available(macOS 14, iOS 17, tvOS 17, *)
178183
public struct Application<Responder: HTTPResponder>: ApplicationProtocol
179184
where Responder.Context: InitializableFromSource<ApplicationRequestContextSource> {
180185
// MARK: Member variables
@@ -303,6 +308,7 @@ where Responder.Context: InitializableFromSource<ApplicationRequestContextSource
303308
}
304309
}
305310

311+
@available(macOS 14, iOS 17, tvOS 17, *)
306312
extension Application: CustomStringConvertible {
307313
public var description: String { "Application" }
308314
}

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedForm+Request.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// SPDX-License-Identifier: Apache-2.0
77
//
88

9+
@available(macOS 14, iOS 17, tvOS 17, *)
910
extension URLEncodedFormEncoder: ResponseEncoder {
1011
/// Extend URLEncodedFormEncoder to support generating a ``HummingbirdCore/Response``. Sets body and header values
1112
/// - Parameters:
@@ -26,6 +27,7 @@ extension URLEncodedFormEncoder: ResponseEncoder {
2627
}
2728
}
2829

30+
@available(macOS 14, iOS 17, tvOS 17, *)
2931
extension URLEncodedFormDecoder: RequestDecoder {
3032
/// Extend URLEncodedFormDecoder to decode from ``HummingbirdCore/Request``.
3133
/// - Parameters:

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormDecoder.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
public import Foundation
1010

1111
/// The wrapper struct for decoding URL encoded form data to Codable classes
12+
@available(macOS 14, iOS 17, tvOS 17, *)
1213
public struct URLEncodedFormDecoder: Sendable {
1314
/// The strategy to use for decoding `Date` values.
1415
public enum DateDecodingStrategy: Sendable {
@@ -75,6 +76,7 @@ public struct URLEncodedFormDecoder: Sendable {
7576
}
7677
}
7778

79+
@available(macOS 14, iOS 17, tvOS 17, *)
7880
private class _URLEncodedFormDecoder: Decoder {
7981
// MARK: Properties
8082

@@ -421,6 +423,7 @@ private class _URLEncodedFormDecoder: Decoder {
421423
}
422424
}
423425

426+
@available(macOS 14, iOS 17, tvOS 17, *)
424427
extension _URLEncodedFormDecoder: SingleValueDecodingContainer {
425428
func decodeNil() -> Bool {
426429
(try? self.unboxNil(self.storage.topContainer)) ?? false
@@ -487,6 +490,7 @@ extension _URLEncodedFormDecoder: SingleValueDecodingContainer {
487490
}
488491
}
489492

493+
@available(macOS 14, iOS 17, tvOS 17, *)
490494
extension _URLEncodedFormDecoder {
491495
func unboxNil(_ node: URLEncodedFormNode) throws -> Bool {
492496
switch node {
@@ -686,6 +690,7 @@ extension _URLEncodedFormDecoder {
686690
}
687691
}
688692

693+
@available(macOS 14, iOS 17, tvOS 17, *)
689694
private struct URLEncodedFormDecodingStorage {
690695
/// the container stack
691696
private var containers: [URLEncodedFormNode] = []

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
public import Foundation
1010

1111
/// The wrapper struct for encoding Codable classes to URL encoded form data
12+
@available(macOS 14, iOS 17, tvOS 17, *)
1213
public struct URLEncodedFormEncoder: Sendable {
1314
/// The strategy to use for encoding `Date` values.
1415
public enum DateEncodingStrategy: Sendable {
@@ -80,6 +81,7 @@ public struct URLEncodedFormEncoder: Sendable {
8081
}
8182

8283
/// Internal QueryEncoder class. Does all the heavy lifting
84+
@available(macOS 14, iOS 17, tvOS 17, *)
8385
private class _URLEncodedFormEncoder: Encoder {
8486
var codingPath: [any CodingKey]
8587

@@ -273,6 +275,7 @@ private class _URLEncodedFormEncoder: Encoder {
273275
}
274276
}
275277

278+
@available(macOS 14, iOS 17, tvOS 17, *)
276279
extension _URLEncodedFormEncoder: SingleValueEncodingContainer {
277280
func encodeResult(_ value: URLEncodedFormNode) {
278281
self.storage.push(container: value)
@@ -310,6 +313,7 @@ extension _URLEncodedFormEncoder: SingleValueEncodingContainer {
310313
}
311314
}
312315

316+
@available(macOS 14, iOS 17, tvOS 17, *)
313317
extension _URLEncodedFormEncoder {
314318
func box(_ date: Date) throws -> URLEncodedFormNode {
315319
switch self.options.dateEncodingStrategy {
@@ -355,6 +359,7 @@ extension _URLEncodedFormEncoder {
355359
}
356360

357361
/// storage for Query Encoder. Stores a stack of QueryEncoder containers, plus leaf objects
362+
@available(macOS 14, iOS 17, tvOS 17, *)
358363
private struct URLEncodedFormEncoderStorage {
359364
/// the container stack
360365
private var containers: [URLEncodedFormNode] = []

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormNode.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ extension URLEncodedFormError {
7171
}
7272
}
7373
/// Internal representation of URL encoded form data used by both encode and decode
74+
@available(macOS 14, iOS 17, tvOS 17, *)
7475
enum URLEncodedFormNode: CustomStringConvertible, Equatable {
7576
/// holds a value
7677
case leaf(NodeValue?)

Sources/Hummingbird/HTTP/Cookie.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public import Foundation
1313
#endif
1414

1515
/// Structure holding a single cookie
16+
@available(macOS 14, iOS 17, tvOS 17, *)
1617
public struct Cookie: Sendable, CustomStringConvertible {
1718
public struct ValidationError: Error {
1819
enum Reason {

Sources/Hummingbird/HTTP/Cookies.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/// Structure holding an array of cookies
1010
///
1111
/// Cookies can be accessed from request via `Request.cookies`.
12+
@available(macOS 14, iOS 17, tvOS 17, *)
1213
public struct Cookies: Sendable {
1314
/// Construct cookies accessor from `Request`
1415
/// - Parameter request: request to get cookies from

0 commit comments

Comments
 (0)