Remove _NIOBeta (#2319)

Motivation:

Having deprecated the NIOBeta entrypoints in #2300, we can now safely
remove it.

Modifications:

Remove all source files in _NIOBeta
Remove the _NIOBeta product and target

Result:

We're ready for 5.8 work!
This commit is contained in:
Cory Benfield 2022-11-21 14:56:23 +00:00 committed by GitHub
parent e855380cb5
commit dd074002a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 67 deletions

View File

@ -42,8 +42,6 @@ var targets: [PackageDescription.Target] = [
"NIOPosix"]), "NIOPosix"]),
.target(name: "_NIOConcurrency", .target(name: "_NIOConcurrency",
dependencies: ["NIO", "NIOCore"]), dependencies: ["NIO", "NIOCore"]),
.target(name: "_NIOBeta",
dependencies: ["NIOCore"]),
.target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]), .target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]),
.target(name: "CNIOAtomics", dependencies: []), .target(name: "CNIOAtomics", dependencies: []),
.target(name: "CNIOSHA1", dependencies: []), .target(name: "CNIOSHA1", dependencies: []),
@ -133,7 +131,6 @@ let package = Package(
.library(name: "NIOEmbedded", targets: ["NIOEmbedded"]), .library(name: "NIOEmbedded", targets: ["NIOEmbedded"]),
.library(name: "NIOPosix", targets: ["NIOPosix"]), .library(name: "NIOPosix", targets: ["NIOPosix"]),
.library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]), .library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]),
.library(name: "_NIOBeta", targets: ["_NIOBeta"]),
.library(name: "NIOTLS", targets: ["NIOTLS"]), .library(name: "NIOTLS", targets: ["NIOTLS"]),
.library(name: "NIOHTTP1", targets: ["NIOHTTP1"]), .library(name: "NIOHTTP1", targets: ["NIOHTTP1"]),
.library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]), .library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]),

View File

@ -41,8 +41,6 @@ var targets: [PackageDescription.Target] = [
"NIOPosix"]), "NIOPosix"]),
.target(name: "_NIOConcurrency", .target(name: "_NIOConcurrency",
dependencies: ["NIO", "NIOCore"]), dependencies: ["NIO", "NIOCore"]),
.target(name: "_NIOBeta",
dependencies: ["NIOCore"]),
.target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]), .target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]),
.target(name: "CNIOAtomics", dependencies: []), .target(name: "CNIOAtomics", dependencies: []),
.target(name: "CNIOSHA1", dependencies: []), .target(name: "CNIOSHA1", dependencies: []),
@ -132,7 +130,6 @@ let package = Package(
.library(name: "NIOEmbedded", targets: ["NIOEmbedded"]), .library(name: "NIOEmbedded", targets: ["NIOEmbedded"]),
.library(name: "NIOPosix", targets: ["NIOPosix"]), .library(name: "NIOPosix", targets: ["NIOPosix"]),
.library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]), .library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]),
.library(name: "_NIOBeta", targets: ["_NIOBeta"]),
.library(name: "NIOTLS", targets: ["NIOTLS"]), .library(name: "NIOTLS", targets: ["NIOTLS"]),
.library(name: "NIOHTTP1", targets: ["NIOHTTP1"]), .library(name: "NIOHTTP1", targets: ["NIOHTTP1"]),
.library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]), .library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]),

View File

@ -1,61 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
#if (os(macOS) && swift(>=5.7.1)) || (!os(macOS) && swift(>=5.7))
extension TimeAmount {
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
@available(*, deprecated, message: "This API has been moved to NIOCore and will be removed in a future update.")
/// Creates a new `TimeAmount` for the given `Duration`, truncating and clamping if necessary.
///
/// - returns: `TimeAmount`, truncated to nanosecond precision, and clamped to `Int64.max` nanoseconds.
public init(_ duration: Swift.Duration) {
self = .nanoseconds(duration.nanosecondsClamped)
}
}
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
extension Swift.Duration {
/// Construct a `Duration` given a number of nanoseconds represented as a `TimeAmount`.
///
/// - returns: A `Duration` representing a given number of nanoseconds.
@available(*, deprecated, message: "This API has been moved to NIOCore and will be removed in a future update.")
public init(_ timeAmount: TimeAmount) {
self = .nanoseconds(timeAmount.nanoseconds)
}
}
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
internal extension Swift.Duration {
/// The duration represented as nanoseconds, clamped to maximum expressible value.
@available(*, deprecated, message: "This API has been moved to NIOCore and will be removed in a future update.")
var nanosecondsClamped: Int64 {
let components = self.components
let secondsComponentNanos = components.seconds.multipliedReportingOverflow(by: 1_000_000_000)
let attosCompononentNanos = components.attoseconds / 1_000_000_000
let combinedNanos = secondsComponentNanos.partialValue.addingReportingOverflow(attosCompononentNanos)
guard
!secondsComponentNanos.overflow,
!combinedNanos.overflow
else {
return .max
}
return combinedNanos.partialValue
}
}
#endif // (os(macOS) && swift(>=5.7.1)) || (!os(macOS) && swift(>=5.7))