Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise minimum Swift version for async/await #1379

Merged
merged 3 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// NOTE: This file should be removed when the `async` branch of `swift-argument-parser` has been
/// released: https://github.com/apple/swift-argument-parser/tree/async

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import ArgumentParser

Expand Down
2 changes: 1 addition & 1 deletion Sources/Examples/Echo/AsyncAwaitRuntime/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import ArgumentParser
import EchoImplementation
Expand Down
4 changes: 2 additions & 2 deletions Sources/Examples/Echo/Implementation/EchoAsyncProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
import EchoModel
import GRPC

Expand Down Expand Up @@ -69,4 +69,4 @@ public final class EchoAsyncProvider: Echo_EchoAsyncProvider {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
8 changes: 4 additions & 4 deletions Sources/Examples/Echo/Model/echo.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public final class Echo_EchoClient: Echo_EchoClientProtocol {
}
}

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol Echo_EchoAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
Expand Down Expand Up @@ -329,7 +329,7 @@ public struct Echo_EchoAsyncClient: Echo_EchoAsyncClientProtocol {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Echo_EchoClientInterceptorFactoryProtocol {

Expand Down Expand Up @@ -573,7 +573,7 @@ extension Echo_EchoProvider {
}
}
}
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
Expand Down Expand Up @@ -669,7 +669,7 @@ extension Echo_EchoAsyncProvider {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Echo_EchoServerInterceptorFactoryProtocol {

Expand Down
8 changes: 4 additions & 4 deletions Sources/Examples/HelloWorld/Model/helloworld.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public final class Helloworld_GreeterClient: Helloworld_GreeterClientProtocol {
}
}

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
/// The greeting service definition.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol Helloworld_GreeterAsyncClientProtocol: GRPCClient {
Expand Down Expand Up @@ -152,7 +152,7 @@ public struct Helloworld_GreeterAsyncClient: Helloworld_GreeterAsyncClientProtoc
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Helloworld_GreeterClientInterceptorFactoryProtocol {

Expand Down Expand Up @@ -214,7 +214,7 @@ extension Helloworld_GreeterProvider {
}
}
}
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// The greeting service definition.
///
Expand Down Expand Up @@ -265,7 +265,7 @@ extension Helloworld_GreeterAsyncProvider {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Helloworld_GreeterServerInterceptorFactoryProtocol {

Expand Down
4 changes: 2 additions & 2 deletions Sources/Examples/RouteGuide/Client/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
import ArgumentParser
import Foundation
import GRPC
Expand Down Expand Up @@ -274,4 +274,4 @@ if #available(macOS 12, *) {
}
#else
fatalError("The RouteGuide example requires Swift concurrency features.")
#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
8 changes: 4 additions & 4 deletions Sources/Examples/RouteGuide/Model/route_guide.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public final class Routeguide_RouteGuideClient: Routeguide_RouteGuideClientProto
}
}

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
/// Interface exported by the server.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol Routeguide_RouteGuideAsyncClientProtocol: GRPCClient {
Expand Down Expand Up @@ -348,7 +348,7 @@ public struct Routeguide_RouteGuideAsyncClient: Routeguide_RouteGuideAsyncClient
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Routeguide_RouteGuideClientInterceptorFactoryProtocol {

Expand Down Expand Up @@ -492,7 +492,7 @@ extension Routeguide_RouteGuideProvider {
}
}
}
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// Interface exported by the server.
///
Expand Down Expand Up @@ -606,7 +606,7 @@ extension Routeguide_RouteGuideAsyncProvider {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

public protocol Routeguide_RouteGuideServerInterceptorFactoryProtocol {

Expand Down
4 changes: 2 additions & 2 deletions Sources/Examples/RouteGuide/Server/RouteGuideProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import NIOConcurrencyHelpers
import NIOCore
import RouteGuideModel

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal final class RouteGuideProvider: Routeguide_RouteGuideAsyncProvider {
Expand Down Expand Up @@ -130,7 +130,7 @@ internal final actor Notes {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)

private func degreesToRadians(_ degrees: Double) -> Double {
return degrees * .pi / 180.0
Expand Down
4 changes: 2 additions & 2 deletions Sources/Examples/RouteGuide/Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
import ArgumentParser
import struct Foundation.Data
import struct Foundation.URL
Expand Down Expand Up @@ -76,4 +76,4 @@ if #available(macOS 12, *) {
}
#else
fatalError("The RouteGuide example requires Swift concurrency support.")
#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
4 changes: 2 additions & 2 deletions Sources/GRPC/AsyncAwaitSupport/AsyncWriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
import NIOCore

/// An asynchronous writer which forwards messages to a delegate.
Expand Down Expand Up @@ -334,4 +334,4 @@ internal protocol AsyncWriterDelegate: AnyObject {
func writeEnd(_ end: End)
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Call {
Expand All @@ -30,4 +30,4 @@ extension Call {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension CancellationError: GRPCStatusTransformable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import NIOHPACK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import NIOHPACK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// This is currently a wrapper around AsyncThrowingStream because we want to be
/// able to swap out the implementation for something else in the future.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// An object allowing the holder -- a client -- to send requests on an RPC.
///
Expand Down Expand Up @@ -124,4 +124,4 @@ extension GRPCAsyncRequestStreamWriter {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// This is currently a wrapper around AsyncThrowingStream because we want to be
/// able to swap out the implementation for something else in the future.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// Writer for server-streaming RPC handlers to provide responses.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import Logging
import NIOConcurrencyHelpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import NIOCore
import NIOHPACK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import NIOHPACK

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import NIOHPACK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import SwiftProtobuf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

import SwiftProtobuf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)

/// An ``AsyncSequence`` adapter for a ``PassthroughMessageSource``.`
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
Expand Down Expand Up @@ -55,4 +55,4 @@ internal struct PassthroughMessageSequence<Element, Failure: Error>: AsyncSequen
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
4 changes: 2 additions & 2 deletions Sources/GRPC/AsyncAwaitSupport/PassthroughMessageSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if compiler(>=5.5.2) && canImport(_Concurrency)
#if compiler(>=5.6)
import NIOConcurrencyHelpers
import NIOCore

Expand Down Expand Up @@ -160,4 +160,4 @@ internal final class PassthroughMessageSource<Element, Failure: Error> {
}
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
#endif // compiler(>=5.6)
Loading