Browse Source

Drop support for Swift 5.5 (#1585)

Motivation:

Now that 5.8 has been released we can drop support for Swift 5.5.

Modifications:

- Update CI jobs
- Remove conditional branches which are no longer supported
- Update docs

Result:

Swift 5.6 is the lowest supported Swift version
George Barnett 2 years ago
parent
commit
044f7838e9

+ 1 - 8
Sources/protoc-gen-grpc-swift/Generator-Client.swift

@@ -29,7 +29,6 @@ extension Generator {
       self.println()
       self.printStructBackedServiceClientImplementation()
       self.println()
-      self.printIfCompilerGuardForAsyncAwait()
       self.printAsyncServiceClientProtocol()
       self.println()
       self.printAsyncClientProtocolExtension()
@@ -38,8 +37,6 @@ extension Generator {
       self.println()
       self.printAsyncServiceClientImplementation()
       self.println()
-      self.printEndCompilerGuardForAsyncAwait()
-      self.println()
       // Both implementations share definitions for interceptors and metadata.
       self.printServiceClientInterceptorFactoryProtocol()
       self.println()
@@ -159,7 +156,7 @@ extension Generator {
   }
 
   private func printServiceClientInterceptorFactoryProtocol() {
-    self.println("\(self.access) protocol \(self.clientInterceptorProtocolName): GRPCSendable {")
+    self.println("\(self.access) protocol \(self.clientInterceptorProtocolName): Sendable {")
     self.withIndentation {
       // Method specific interceptors.
       for method in service.methods {
@@ -189,10 +186,8 @@ extension Generator {
   }
 
   private func printClassBackedServiceClientImplementation() {
-    self.printIfCompilerGuardForAsyncAwait()
     self.println("@available(*, deprecated)")
     self.println("extension \(clientClassName): @unchecked Sendable {}")
-    self.printEndCompilerGuardForAsyncAwait()
     self.println()
     self.println("@available(*, deprecated, renamed: \"\(clientStructName)\")")
     println("\(access) final class \(clientClassName): \(clientProtocolName) {")
@@ -534,10 +529,8 @@ extension Generator {
   }
 
   private func printTestClient() {
-    self.printIfCompilerGuardForAsyncAwait()
     self.println("@available(swift, deprecated: 5.6)")
     self.println("extension \(self.testClientClassName): @unchecked Sendable {}")
-    self.printEndCompilerGuardForAsyncAwait()
     self.println()
     self.println(
       "@available(swift, deprecated: 5.6, message: \"Test clients are not Sendable "

+ 0 - 4
Sources/protoc-gen-grpc-swift/Generator-Server.swift

@@ -24,14 +24,10 @@ extension Generator {
       self.println()
       self.printServerProtocolExtension()
       self.println()
-      self.printIfCompilerGuardForAsyncAwait()
-      self.println()
       self.printServerProtocolAsyncAwait()
       self.println()
       self.printServerProtocolExtensionAsyncAwait()
       self.println()
-      self.printEndCompilerGuardForAsyncAwait()
-      self.println()
       // Both implementations share definitions for interceptors and metadata.
       self.printServerInterceptorFactoryProtocol()
       self.println()

+ 0 - 8
Sources/protoc-gen-grpc-swift/Generator.swift

@@ -169,12 +169,4 @@ class Generator {
   func printAvailabilityForAsyncAwait() {
     self.println("@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)")
   }
-
-  func printIfCompilerGuardForAsyncAwait() {
-    self.println("#if compiler(>=5.6)")
-  }
-
-  func printEndCompilerGuardForAsyncAwait() {
-    self.println("#endif // compiler(>=5.6)")
-  }
 }