Skip to content

Commit a9e15b1

Browse files
authored
Fix platform requirements (#214)
- Replace the placeholder platform requirements with `@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)` - Bump required dependency versions: `swift-nio`, `swift-log` and `swift-backtrace`
1 parent fce7884 commit a9e15b1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Package.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ let package = Package(
1515
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
1616
],
1717
dependencies: [
18-
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.28.0")),
19-
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.0.0")),
20-
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.1.0")),
18+
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.30.0")),
19+
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
20+
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
2121
],
2222
targets: [
2323
.target(name: "AWSLambdaRuntime", dependencies: [

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ extension LambdaHandler {
8989

9090
#if compiler(>=5.5)
9191
/// Strongly typed, processing protocol for a Lambda that takes a user defined `In` and returns a user defined `Out` async.
92-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
92+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
9393
public protocol AsyncLambdaHandler: EventLoopLambdaHandler {
9494
/// The Lambda initialization method
9595
/// Use this method to initialize resources that will be used in every request.
@@ -110,7 +110,7 @@ public protocol AsyncLambdaHandler: EventLoopLambdaHandler {
110110
func handle(event: In, context: Lambda.Context) async throws -> Out
111111
}
112112

113-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
113+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
114114
extension AsyncLambdaHandler {
115115
public func handle(context: Lambda.Context, event: In) -> EventLoopFuture<Out> {
116116
let promise = context.eventLoop.makePromise(of: Out.self)
@@ -121,7 +121,7 @@ extension AsyncLambdaHandler {
121121
}
122122
}
123123

124-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
124+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
125125
extension AsyncLambdaHandler {
126126
public static func main() {
127127
Lambda.run { context -> EventLoopFuture<ByteBufferLambdaHandler> in

Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class LambdaHandlerTest: XCTestCase {
8383

8484
// MARK: - AsyncLambdaHandler
8585

86-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
86+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
8787
func testAsyncHandlerSuccess() {
8888
let server = MockLambdaServer(behavior: Behavior())
8989
XCTAssertNoThrow(try server.start().wait())
@@ -106,7 +106,7 @@ class LambdaHandlerTest: XCTestCase {
106106
assertLambdaLifecycleResult(result, shoudHaveRun: maxTimes)
107107
}
108108

109-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
109+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
110110
func testVoidAsyncHandlerSuccess() {
111111
let server = MockLambdaServer(behavior: Behavior(result: .success(nil)))
112112
XCTAssertNoThrow(try server.start().wait())
@@ -127,7 +127,7 @@ class LambdaHandlerTest: XCTestCase {
127127
assertLambdaLifecycleResult(result, shoudHaveRun: maxTimes)
128128
}
129129

130-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
130+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
131131
func testAsyncHandlerFailure() {
132132
let server = MockLambdaServer(behavior: Behavior(result: .failure(TestError("boom"))))
133133
XCTAssertNoThrow(try server.start().wait())

0 commit comments

Comments
 (0)