diff --git a/Package.swift b/Package.swift index e086fd6..3a877d5 100644 --- a/Package.swift +++ b/Package.swift @@ -28,6 +28,7 @@ let package = Package( name: "NIOTransportServices", dependencies: [ .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOFoundationCompat", package: "swift-nio"), .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), .product(name: "NIOTLS", package: "swift-nio"), @@ -36,21 +37,22 @@ let package = Package( name: "NIOTSHTTPClient", dependencies: [ "NIOTransportServices", - .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), ]), .target( name: "NIOTSHTTPServer", dependencies: [ "NIOTransportServices", - .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), ]), .testTarget( name: "NIOTransportServicesTests", dependencies: [ "NIOTransportServices", - .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), + .product(name: "NIOEmbedded", package: "swift-nio"), .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), ]), ] diff --git a/Sources/NIOTSHTTPClient/main.swift b/Sources/NIOTSHTTPClient/main.swift index 51ca4aa..bfbe62e 100644 --- a/Sources/NIOTSHTTPClient/main.swift +++ b/Sources/NIOTSHTTPClient/main.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore import NIOTransportServices import NIOHTTP1 import Network diff --git a/Sources/NIOTSHTTPServer/main.swift b/Sources/NIOTSHTTPServer/main.swift index fa07eb8..17d920a 100644 --- a/Sources/NIOTSHTTPServer/main.swift +++ b/Sources/NIOTSHTTPServer/main.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore import NIOTransportServices import NIOHTTP1 import Network diff --git a/Sources/NIOTransportServices/NIOFilterEmptyWritesHandler.swift b/Sources/NIOTransportServices/NIOFilterEmptyWritesHandler.swift index 9aa3d2e..a50ceb1 100644 --- a/Sources/NIOTransportServices/NIOFilterEmptyWritesHandler.swift +++ b/Sources/NIOTransportServices/NIOFilterEmptyWritesHandler.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -import NIO +import NIOCore /// A `ChannelHandler` that checks for outbound writes of zero length, which are then dropped. This is diff --git a/Sources/NIOTransportServices/NIOTSBootstraps.swift b/Sources/NIOTransportServices/NIOTSBootstraps.swift index 384caaa..4dfc210 100644 --- a/Sources/NIOTransportServices/NIOTSBootstraps.swift +++ b/Sources/NIOTransportServices/NIOTSBootstraps.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore /// Shared functionality across NIOTS bootstraps. internal enum NIOTSBootstraps { diff --git a/Sources/NIOTransportServices/NIOTSChannelOptions.swift b/Sources/NIOTransportServices/NIOTSChannelOptions.swift index 5bf014f..88ad014 100644 --- a/Sources/NIOTransportServices/NIOTSChannelOptions.swift +++ b/Sources/NIOTransportServices/NIOTSChannelOptions.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore import Network /// Options that can be set explicitly and only on bootstraps provided by `NIOTransportServices`. diff --git a/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift b/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift index e580291..7170b40 100644 --- a/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift +++ b/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore import Dispatch import Network diff --git a/Sources/NIOTransportServices/NIOTSConnectionChannel.swift b/Sources/NIOTransportServices/NIOTSConnectionChannel.swift index b5b079b..61c9195 100644 --- a/Sources/NIOTransportServices/NIOTSConnectionChannel.swift +++ b/Sources/NIOTransportServices/NIOTSConnectionChannel.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Foundation -import NIO +import NIOCore import NIOConcurrencyHelpers import NIOFoundationCompat import NIOTLS diff --git a/Sources/NIOTransportServices/NIOTSErrors.swift b/Sources/NIOTransportServices/NIOTSErrors.swift index e35a4d1..52fde1f 100644 --- a/Sources/NIOTransportServices/NIOTSErrors.swift +++ b/Sources/NIOTransportServices/NIOTSErrors.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore /// A tag protocol that can be used to cover all errors thrown by `NIOTransportServices`. /// diff --git a/Sources/NIOTransportServices/NIOTSEventLoop.swift b/Sources/NIOTransportServices/NIOTSEventLoop.swift index 9ff9631..7ae09f8 100644 --- a/Sources/NIOTransportServices/NIOTSEventLoop.swift +++ b/Sources/NIOTransportServices/NIOTSEventLoop.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -17,7 +17,7 @@ import Dispatch import Foundation import Network -import NIO +import NIOCore import NIOConcurrencyHelpers /// An `EventLoop` that interacts with `DispatchQoS` to help schedule upcoming work. diff --git a/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift b/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift index bc391d3..267467e 100644 --- a/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift +++ b/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Foundation -import NIO +import NIOCore import NIOConcurrencyHelpers import Dispatch import Network diff --git a/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift b/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift index fa0e312..053c3f7 100644 --- a/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift +++ b/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if canImport(Network) -import NIO +import NIOCore import Dispatch import Network diff --git a/Sources/NIOTransportServices/NIOTSListenerChannel.swift b/Sources/NIOTransportServices/NIOTSListenerChannel.swift index 3b562d1..a6cbb55 100644 --- a/Sources/NIOTransportServices/NIOTSListenerChannel.swift +++ b/Sources/NIOTransportServices/NIOTSListenerChannel.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Foundation -import NIO +import NIOCore import NIOFoundationCompat import NIOConcurrencyHelpers import Dispatch diff --git a/Sources/NIOTransportServices/NIOTSNetworkEvents.swift b/Sources/NIOTransportServices/NIOTSNetworkEvents.swift index 28dcb99..7fdd489 100644 --- a/Sources/NIOTransportServices/NIOTSNetworkEvents.swift +++ b/Sources/NIOTransportServices/NIOTSNetworkEvents.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Network -import NIO +import NIOCore /// A tag protocol that can be used to cover all network events emitted by `NIOTS`. /// diff --git a/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift b/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift index cb8ffef..8e27b54 100644 --- a/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift +++ b/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -15,7 +15,7 @@ #if canImport(Network) import Darwin import Foundation -import NIO +import NIOCore import Network @available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) diff --git a/Sources/NIOTransportServices/StateManagedChannel.swift b/Sources/NIOTransportServices/StateManagedChannel.swift index c7b2d95..f79f0e4 100644 --- a/Sources/NIOTransportServices/StateManagedChannel.swift +++ b/Sources/NIOTransportServices/StateManagedChannel.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Foundation -import NIO +import NIOCore import NIOFoundationCompat import NIOConcurrencyHelpers import Dispatch diff --git a/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift b/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift index 0766014..666b7cf 100644 --- a/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift +++ b/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import Foundation -import NIO +import NIOCore import Network @available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) diff --git a/Tests/NIOTransportServicesTests/NIOFilterEmptyWritesHandlerTests.swift b/Tests/NIOTransportServicesTests/NIOFilterEmptyWritesHandlerTests.swift index 457fce1..7cd580c 100644 --- a/Tests/NIOTransportServicesTests/NIOFilterEmptyWritesHandlerTests.swift +++ b/Tests/NIOTransportServicesTests/NIOFilterEmptyWritesHandlerTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,8 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore +import NIOEmbedded import NIOTransportServices diff --git a/Tests/NIOTransportServicesTests/NIOTSBootstrapTests.swift b/Tests/NIOTransportServicesTests/NIOTSBootstrapTests.swift index 94ec461..4b2dc6c 100644 --- a/Tests/NIOTransportServicesTests/NIOTSBootstrapTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSBootstrapTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -15,7 +15,8 @@ #if canImport(Network) import XCTest import Network -import NIO +import NIOCore +import NIOEmbedded import NIOTransportServices import NIOConcurrencyHelpers import Foundation diff --git a/Tests/NIOTransportServicesTests/NIOTSChannelOptionsTests.swift b/Tests/NIOTransportServicesTests/NIOTSChannelOptionsTests.swift index 6f9c2c3..4dc5b17 100644 --- a/Tests/NIOTransportServicesTests/NIOTSChannelOptionsTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSChannelOptionsTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore import NIOConcurrencyHelpers import NIOTransportServices import Network diff --git a/Tests/NIOTransportServicesTests/NIOTSConnectionChannelTests.swift b/Tests/NIOTransportServicesTests/NIOTSConnectionChannelTests.swift index 48fb489..cf0847a 100644 --- a/Tests/NIOTransportServicesTests/NIOTSConnectionChannelTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSConnectionChannelTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -15,7 +15,7 @@ #if canImport(Network) import XCTest import Network -import NIO +import NIOCore import NIOTransportServices import Foundation diff --git a/Tests/NIOTransportServicesTests/NIOTSEndToEndTests.swift b/Tests/NIOTransportServicesTests/NIOTSEndToEndTests.swift index 1e678b9..94a81cb 100644 --- a/Tests/NIOTransportServicesTests/NIOTSEndToEndTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSEndToEndTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore import NIOTransportServices import Foundation import Network diff --git a/Tests/NIOTransportServicesTests/NIOTSEventLoopTests.swift b/Tests/NIOTransportServicesTests/NIOTSEventLoopTests.swift index bf1306d..ed3dbae 100644 --- a/Tests/NIOTransportServicesTests/NIOTSEventLoopTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSEventLoopTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore import NIOConcurrencyHelpers import NIOTransportServices diff --git a/Tests/NIOTransportServicesTests/NIOTSListenerChannelTests.swift b/Tests/NIOTransportServicesTests/NIOTSListenerChannelTests.swift index 80cc3c0..9135ceb 100644 --- a/Tests/NIOTransportServicesTests/NIOTSListenerChannelTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSListenerChannelTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -15,7 +15,7 @@ #if canImport(Network) import XCTest import Network -import NIO +import NIOCore import NIOTransportServices diff --git a/Tests/NIOTransportServicesTests/NIOTSSocketOptionTests.swift b/Tests/NIOTransportServicesTests/NIOTSSocketOptionTests.swift index f040607..50ce000 100644 --- a/Tests/NIOTransportServicesTests/NIOTSSocketOptionTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSSocketOptionTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore import Network @testable import NIOTransportServices diff --git a/Tests/NIOTransportServicesTests/NIOTSSocketOptionsOnChannelTests.swift b/Tests/NIOTransportServicesTests/NIOTSSocketOptionsOnChannelTests.swift index 5b9f9e8..4d367ae 100644 --- a/Tests/NIOTransportServicesTests/NIOTSSocketOptionsOnChannelTests.swift +++ b/Tests/NIOTransportServicesTests/NIOTSSocketOptionsOnChannelTests.swift @@ -2,7 +2,7 @@ // // This source file is part of the SwiftNIO open source project // -// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -14,7 +14,7 @@ #if canImport(Network) import XCTest -import NIO +import NIOCore import Network @testable import NIOTransportServices diff --git a/scripts/soundness.sh b/scripts/soundness.sh index d327eab..12ff9d4 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -21,6 +21,15 @@ function replace_acceptable_years() { sed -e 's/20[12][78901]-20[12][8901]/YEARS/' -e 's/20[12][8901]/YEARS/' } +# This checks for the umbrella NIO module. +printf "=> Checking for imports of umbrella NIO module... " +if git grep --color=never -i "^[ \t]*import \+NIO[ \t]*$" > /dev/null; then + printf "\033[0;31mUmbrella imports found.\033[0m\n" + git grep -i "^[ \t]*import \+NIO[ \t]*$" + exit 1 +fi +printf "\033[0;32mokay.\033[0m\n" + printf "=> Checking license headers... " tmp=$(mktemp /tmp/.swift-nio-sanity_XXXXXX)