Skip to content

Commit d004347

Browse files
committed
Adopt Concurrency adoption guidelines
1 parent 7c1dea0 commit d004347

File tree

6 files changed

+7
-11
lines changed

6 files changed

+7
-11
lines changed

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public enum Lambda {
5353
return String(cString: value)
5454
}
5555

56-
#if swift(>=5.5)
56+
#if compiler(>=5.5) && canImport(_Concurrency)
5757
// for testing and internal use
5858
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
5959
internal static func run<Handler: LambdaHandler>(configuration: Configuration = .init(), handlerType: Handler.Type) -> Result<Int, Error> {

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import NIOCore
1717

1818
// MARK: - LambdaHandler
1919

20-
#if compiler(>=5.5)
20+
#if compiler(>=5.5) && canImport(_Concurrency)
2121
/// Strongly typed, processing protocol for a Lambda that takes a user defined `Event` and returns a user defined `Output` async.
2222
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
2323
public protocol LambdaHandler: EventLoopLambdaHandler {
@@ -51,7 +51,6 @@ extension LambdaHandler {
5151
}
5252
}
5353

54-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
5554
extension LambdaHandler {
5655
public static func main() {
5756
_ = Lambda.run(handlerType: Self.self)

Sources/AWSLambdaTesting/Lambda+Testing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// XCTAssertEqual(result, "echo" + input)
3636
// }
3737

38-
#if swift(>=5.5)
38+
#if compiler(>=5.5) && canImport(_Concurrency)
3939
import AWSLambdaRuntime
4040
import AWSLambdaRuntimeCore
4141
import Dispatch

Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import NIOCore
1717
import XCTest
1818

1919
class LambdaHandlerTest: XCTestCase {
20-
#if compiler(>=5.5)
20+
#if compiler(>=5.5) && canImport(_Concurrency)
2121

2222
// MARK: - LambdaHandler
2323

Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift renamed to Tests/AWSLambdaRuntimeTests/Lambda+CodableTest.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ class CodableLambdaTest: XCTestCase {
8282
XCTAssertEqual(response?.requestId, request.requestId)
8383
}
8484

85-
#if swift(>=5.5)
86-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
85+
#if compiler(>=5.5) && canImport(_Concurrency)
8786
func testCodableVoidHandler() {
8887
struct Handler: LambdaHandler {
8988
typealias Event = Request
@@ -112,7 +111,6 @@ class CodableLambdaTest: XCTestCase {
112111
}
113112
}
114113

115-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
116114
func testCodableHandler() {
117115
struct Handler: LambdaHandler {
118116
typealias Event = Request
@@ -179,11 +177,10 @@ private struct Response: Codable, Equatable {
179177
}
180178
}
181179

182-
#if swift(>=5.5)
180+
#if compiler(>=5.5) && canImport(_Concurrency)
183181
// NOTE: workaround until we have async test support on linux
184182
// https://github.com/apple/swift-corelibs-xctest/pull/326
185183
extension XCTestCase {
186-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
187184
func XCTAsyncTest(
188185
expectationDescription: String = "Async operation",
189186
timeout: TimeInterval = 3,

Tests/AWSLambdaTestingTests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if swift(>=5.5)
15+
#if compiler(>=5.5) && canImport(_Concurrency)
1616
import AWSLambdaRuntime
1717
import AWSLambdaTesting
1818
import NIOCore

0 commit comments

Comments
 (0)