diff --git a/Package.swift b/Package.swift index 2f3488ea..e128dd3e 100644 --- a/Package.swift +++ b/Package.swift @@ -20,14 +20,16 @@ let package = Package( targets: [ .target(name: "AWSLambdaRuntime", dependencies: [ .byName(name: "AWSLambdaRuntimeCore"), - .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOFoundationCompat", package: "swift-nio"), ]), .target(name: "AWSLambdaRuntimeCore", dependencies: [ .product(name: "Logging", package: "swift-log"), .product(name: "Backtrace", package: "swift-backtrace"), .product(name: "NIOHTTP1", package: "swift-nio"), - .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), + .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), + .product(name: "NIOPosix", package: "swift-nio"), .product(name: "_NIOConcurrency", package: "swift-nio"), ]), .testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [ diff --git a/Sources/AWSLambdaRuntime/Lambda+Codable.swift b/Sources/AWSLambdaRuntime/Lambda+Codable.swift index e80022a8..0175c8af 100644 --- a/Sources/AWSLambdaRuntime/Lambda+Codable.swift +++ b/Sources/AWSLambdaRuntime/Lambda+Codable.swift @@ -16,7 +16,7 @@ import struct Foundation.Data import class Foundation.JSONDecoder import class Foundation.JSONEncoder -import NIO +import NIOCore import NIOFoundationCompat /// Extension to the `Lambda` companion to enable execution of Lambdas that take and return `Codable` events. diff --git a/Sources/AWSLambdaRuntimeCore/HTTPClient.swift b/Sources/AWSLambdaRuntimeCore/HTTPClient.swift index 1fc62b65..045cd968 100644 --- a/Sources/AWSLambdaRuntimeCore/HTTPClient.swift +++ b/Sources/AWSLambdaRuntimeCore/HTTPClient.swift @@ -12,9 +12,10 @@ // //===----------------------------------------------------------------------===// -import NIO import NIOConcurrencyHelpers +import NIOCore import NIOHTTP1 +import NIOPosix /// A barebone HTTP client to interact with AWS Runtime Engine which is an HTTP server. /// Note that Lambda Runtime API dictate that only one requests runs at a time. diff --git a/Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift b/Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift index 48cea94e..eff33aca 100644 --- a/Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift +++ b/Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift @@ -15,9 +15,10 @@ #if DEBUG import Dispatch import Logging -import NIO import NIOConcurrencyHelpers +import NIOCore import NIOHTTP1 +import NIOPosix // This functionality is designed for local testing hence beind a #if DEBUG flag. // For example: diff --git a/Sources/AWSLambdaRuntimeCore/Lambda+String.swift b/Sources/AWSLambdaRuntimeCore/Lambda+String.swift index c6ceda6a..a96b6add 100644 --- a/Sources/AWSLambdaRuntimeCore/Lambda+String.swift +++ b/Sources/AWSLambdaRuntimeCore/Lambda+String.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import NIO +import NIOCore /// Extension to the `Lambda` companion to enable execution of Lambdas that take and return `String` events. extension Lambda { diff --git a/Sources/AWSLambdaRuntimeCore/Lambda.swift b/Sources/AWSLambdaRuntimeCore/Lambda.swift index 264a5138..c1eccaeb 100644 --- a/Sources/AWSLambdaRuntimeCore/Lambda.swift +++ b/Sources/AWSLambdaRuntimeCore/Lambda.swift @@ -21,7 +21,8 @@ import Darwin.C import _NIOConcurrency import Backtrace import Logging -import NIO +import NIOCore +import NIOPosix public enum Lambda { public typealias Handler = ByteBufferLambdaHandler diff --git a/Sources/AWSLambdaRuntimeCore/LambdaConfiguration.swift b/Sources/AWSLambdaRuntimeCore/LambdaConfiguration.swift index 39a3fb96..c2615a9a 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaConfiguration.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaConfiguration.swift @@ -14,7 +14,7 @@ import Dispatch import Logging -import NIO +import NIOCore extension Lambda { internal struct Configuration: CustomStringConvertible { diff --git a/Sources/AWSLambdaRuntimeCore/LambdaContext.swift b/Sources/AWSLambdaRuntimeCore/LambdaContext.swift index 6806aeb7..a64a49d0 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaContext.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaContext.swift @@ -14,7 +14,7 @@ import Dispatch import Logging -import NIO +import NIOCore // MARK: - InitializationContext diff --git a/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift b/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift index bf02860e..ec6914f6 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift @@ -14,7 +14,7 @@ import _NIOConcurrency import Dispatch -import NIO +import NIOCore // MARK: - LambdaHandler diff --git a/Sources/AWSLambdaRuntimeCore/LambdaLifecycle.swift b/Sources/AWSLambdaRuntimeCore/LambdaLifecycle.swift index ec609901..89bc903b 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaLifecycle.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaLifecycle.swift @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// import Logging -import NIO import NIOConcurrencyHelpers +import NIOCore extension Lambda { /// `Lifecycle` manages the Lambda process lifecycle. diff --git a/Sources/AWSLambdaRuntimeCore/LambdaRunner.swift b/Sources/AWSLambdaRuntimeCore/LambdaRunner.swift index 4ddd4dfd..27487718 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaRunner.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaRunner.swift @@ -14,7 +14,7 @@ import Dispatch import Logging -import NIO +import NIOCore extension Lambda { /// LambdaRunner manages the Lambda runtime workflow, or business logic. diff --git a/Sources/AWSLambdaRuntimeCore/LambdaRuntimeClient.swift b/Sources/AWSLambdaRuntimeCore/LambdaRuntimeClient.swift index 9b9546c4..f60925d6 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaRuntimeClient.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaRuntimeClient.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Logging -import NIO +import NIOCore import NIOHTTP1 /// An HTTP based client for AWS Runtime Engine. This encapsulates the RESTful methods exposed by the Runtime Engine: diff --git a/Sources/AWSLambdaRuntimeCore/Utils.swift b/Sources/AWSLambdaRuntimeCore/Utils.swift index 8d2132cb..9924a05b 100644 --- a/Sources/AWSLambdaRuntimeCore/Utils.swift +++ b/Sources/AWSLambdaRuntimeCore/Utils.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Dispatch -import NIO +import NIOPosix internal enum Consts { static let apiPrefix = "/2018-06-01" diff --git a/Sources/AWSLambdaTesting/Lambda+Testing.swift b/Sources/AWSLambdaTesting/Lambda+Testing.swift index 1826f6d6..ab260bdb 100644 --- a/Sources/AWSLambdaTesting/Lambda+Testing.swift +++ b/Sources/AWSLambdaTesting/Lambda+Testing.swift @@ -38,7 +38,8 @@ @testable import AWSLambdaRuntimeCore import Dispatch import Logging -import NIO +import NIOCore +import NIOPosix extension Lambda { public struct TestConfig { diff --git a/Sources/CodableSample/main.swift b/Sources/CodableSample/main.swift index 59cc8dee..aa2f577b 100644 --- a/Sources/CodableSample/main.swift +++ b/Sources/CodableSample/main.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import AWSLambdaRuntime -import NIO +import NIOCore struct Request: Codable { let body: String diff --git a/Sources/MockServer/main.swift b/Sources/MockServer/main.swift index 72b37ce5..9b995bd5 100644 --- a/Sources/MockServer/main.swift +++ b/Sources/MockServer/main.swift @@ -13,8 +13,9 @@ //===----------------------------------------------------------------------===// import Foundation -import NIO +import NIOCore import NIOHTTP1 +import NIOPosix internal struct MockServer { private let group: EventLoopGroup diff --git a/Sources/StringSample/main.swift b/Sources/StringSample/main.swift index 452160f9..0577fdd7 100644 --- a/Sources/StringSample/main.swift +++ b/Sources/StringSample/main.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import AWSLambdaRuntimeCore -import NIO +import NIOCore // in this example we are receiving and responding with strings struct Handler: EventLoopLambdaHandler { diff --git a/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift b/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift index 3406d52f..747db169 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// @testable import AWSLambdaRuntimeCore -import NIO +import NIOCore import XCTest class LambdaHandlerTest: XCTestCase { diff --git a/Tests/AWSLambdaRuntimeCoreTests/LambdaLifecycleTest.swift b/Tests/AWSLambdaRuntimeCoreTests/LambdaLifecycleTest.swift index 14e32235..fd6bd21f 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/LambdaLifecycleTest.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/LambdaLifecycleTest.swift @@ -14,8 +14,9 @@ @testable import AWSLambdaRuntimeCore import Logging -import NIO +import NIOCore import NIOHTTP1 +import NIOPosix import XCTest class LambdaLifecycleTest: XCTestCase { diff --git a/Tests/AWSLambdaRuntimeCoreTests/LambdaRuntimeClientTest.swift b/Tests/AWSLambdaRuntimeCoreTests/LambdaRuntimeClientTest.swift index 94c8ac62..76bab980 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/LambdaRuntimeClientTest.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/LambdaRuntimeClientTest.swift @@ -14,9 +14,10 @@ @testable import AWSLambdaRuntimeCore import Logging -import NIO +import NIOCore import NIOFoundationCompat import NIOHTTP1 +import NIOPosix import NIOTestUtils import XCTest diff --git a/Tests/AWSLambdaRuntimeCoreTests/LambdaTest.swift b/Tests/AWSLambdaRuntimeCoreTests/LambdaTest.swift index 30fed618..b2dd2936 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/LambdaTest.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/LambdaTest.swift @@ -14,7 +14,8 @@ @testable import AWSLambdaRuntimeCore import Logging -import NIO +import NIOCore +import NIOPosix import XCTest class LambdaTest: XCTestCase { diff --git a/Tests/AWSLambdaRuntimeCoreTests/MockLambdaServer.swift b/Tests/AWSLambdaRuntimeCoreTests/MockLambdaServer.swift index 9f543e66..c0d649be 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/MockLambdaServer.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/MockLambdaServer.swift @@ -15,8 +15,9 @@ @testable import AWSLambdaRuntimeCore import Foundation // for JSON import Logging -import NIO +import NIOCore import NIOHTTP1 +import NIOPosix internal final class MockLambdaServer { private let logger = Logger(label: "MockLambdaServer") diff --git a/Tests/AWSLambdaRuntimeCoreTests/Utils.swift b/Tests/AWSLambdaRuntimeCoreTests/Utils.swift index e3be55d5..9e080076 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/Utils.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/Utils.swift @@ -14,7 +14,8 @@ @testable import AWSLambdaRuntimeCore import Logging -import NIO +import NIOCore +import NIOPosix import XCTest func runLambda(behavior: LambdaServerBehavior, handler: Lambda.Handler) throws { diff --git a/Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift b/Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift index 814977fa..3c228b2c 100644 --- a/Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift +++ b/Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift @@ -15,8 +15,9 @@ @testable import AWSLambdaRuntime @testable import AWSLambdaRuntimeCore import Logging -import NIO +import NIOCore import NIOFoundationCompat +import NIOPosix import XCTest class CodableLambdaTest: XCTestCase { diff --git a/Tests/AWSLambdaTestingTests/Tests.swift b/Tests/AWSLambdaTestingTests/Tests.swift index cd1aa328..218547d2 100644 --- a/Tests/AWSLambdaTestingTests/Tests.swift +++ b/Tests/AWSLambdaTestingTests/Tests.swift @@ -14,7 +14,7 @@ import AWSLambdaRuntime import AWSLambdaTesting -import NIO +import NIOCore import XCTest class LambdaTestingTests: XCTestCase {