Skip to content

Commit 03caeb3

Browse files
committed
Add deployment targets to the package manifest
Motivation: Core components of grpc-swift v2 require API from the latest SDKs. This causes a proliferation of availability annotations through our API. Rather than doing this we can set the minimum platforms in the package manifest. Modifications: - Remove availability annotations - Set platforms in the package manifest Result: - Less boilerplate - Users must set platforms in their package manifest
1 parent 82b3a75 commit 03caeb3

File tree

92 files changed

+7
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7
-298
lines changed

Examples/echo/Sources/Subcommands/Serve.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct Serve: AsyncParsableCommand {
4242
}
4343
}
4444

45-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
4645
struct EchoService: Echo_Echo_ServiceProtocol {
4746
func get(
4847
request: ServerRequest<Echo_EchoRequest>,

Examples/route-guide/Sources/RouteGuide.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import ArgumentParser
1818

1919
@main
20-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
2120
struct RouteGuide: AsyncParsableCommand {
2221
static let configuration = CommandConfiguration(
2322
commandName: "route-guide",

Package.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ let targets: [Target] = [
105105

106106
let package = Package(
107107
name: "grpc-swift",
108+
platforms: [
109+
.macOS(.v15),
110+
.iOS(.v18),
111+
.tvOS(.v18),
112+
.watchOS(.v11),
113+
.visionOS(.v2),
114+
],
108115
products: products,
109116
dependencies: dependencies,
110117
targets: targets

Sources/GRPCCore/Call/Client/CallOptions.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
///
2222
/// You can create the default set of options, which defers all possible
2323
/// configuration to the transport, by using ``CallOptions/defaults``.
24-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
2524
public struct CallOptions: Sendable {
2625
/// The default timeout for the RPC.
2726
///
@@ -108,7 +107,6 @@ public struct CallOptions: Sendable {
108107
}
109108
}
110109

111-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
112110
extension CallOptions {
113111
/// Default call options.
114112
///
@@ -125,7 +123,6 @@ extension CallOptions {
125123
}
126124
}
127125

128-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
129126
extension CallOptions {
130127
package mutating func formUnion(with methodConfig: MethodConfig?) {
131128
guard let methodConfig = methodConfig else { return }

Sources/GRPCCore/Call/Client/ClientInterceptor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
/// ```
8989
///
9090
/// For server-side interceptors see ``ServerInterceptor``.
91-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
9291
public protocol ClientInterceptor: Sendable {
9392
/// Intercept a request object.
9493
///

Sources/GRPCCore/Call/Client/ClientRequest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public struct ClientRequest<Message: Sendable>: Sendable {
6161
///
6262
/// See ``ClientRequest`` for single-message requests and ``StreamingServerRequest`` for the
6363
/// servers representation of a streaming-message request.
64-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
6564
public struct StreamingClientRequest<Message: Sendable>: Sendable {
6665
/// Caller-specified metadata sent to the server at the start of the RPC.
6766
///

Sources/GRPCCore/Call/Client/ClientResponse.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ public struct ClientResponse<Message: Sendable>: Sendable {
198198
/// print("RPC failed with code '\(error.code)'")
199199
/// }
200200
/// ```
201-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
202201
public struct StreamingClientResponse<Message: Sendable>: Sendable {
203202
public struct Contents: Sendable {
204203
/// Metadata received from the server at the beginning of the response.
@@ -325,7 +324,6 @@ extension ClientResponse {
325324
}
326325
}
327326

328-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
329327
extension StreamingClientResponse {
330328
/// Creates a new accepted response.
331329
///

Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+HedgingExecutor.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
public import Synchronization // would be internal but for usableFromInline
1818

19-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
2019
extension ClientRPCExecutor {
2120
@usableFromInline
2221
struct HedgingExecutor<
@@ -62,7 +61,6 @@ extension ClientRPCExecutor {
6261
}
6362
}
6463

65-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
6664
extension ClientRPCExecutor.HedgingExecutor {
6765
@inlinable
6866
func execute<R: Sendable>(
@@ -545,15 +543,13 @@ extension ClientRPCExecutor.HedgingExecutor {
545543
}
546544
}
547545

548-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
549546
@usableFromInline
550547
enum _HedgingTaskResult<R: Sendable>: Sendable {
551548
case rpcHandled(Result<R, any Error>)
552549
case finishedRequest(Result<Void, any Error>)
553550
case timedOut(Result<Void, any Error>)
554551
}
555552

556-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
557553
@usableFromInline
558554
enum _HedgingAttemptTaskResult<R: Sendable, Output: Sendable>: Sendable {
559555
case attemptPicked(Bool)

Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+OneShotExecutor.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
1817
extension ClientRPCExecutor {
1918
/// An executor for requests which doesn't apply retries or hedging. The request has just one
2019
/// attempt at execution.
@@ -54,7 +53,6 @@ extension ClientRPCExecutor {
5453
}
5554
}
5655

57-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
5856
extension ClientRPCExecutor.OneShotExecutor {
5957
@inlinable
6058
func execute<R: Sendable>(
@@ -90,7 +88,6 @@ extension ClientRPCExecutor.OneShotExecutor {
9088
}
9189
}
9290

93-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
9491
extension ClientRPCExecutor.OneShotExecutor {
9592
@inlinable
9693
func _execute<R: Sendable>(
@@ -129,7 +126,6 @@ extension ClientRPCExecutor.OneShotExecutor {
129126
}
130127
}
131128

132-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
133129
@inlinable
134130
func withDeadline<Result: Sendable>(
135131
_ deadline: ContinuousClock.Instant,

Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+RetryExecutor.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
1817
extension ClientRPCExecutor {
1918
@usableFromInline
2019
struct RetryExecutor<
@@ -60,7 +59,6 @@ extension ClientRPCExecutor {
6059
}
6160
}
6261

63-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
6462
extension ClientRPCExecutor.RetryExecutor {
6563
@inlinable
6664
func execute<R: Sendable>(
@@ -302,7 +300,6 @@ extension ClientRPCExecutor.RetryExecutor {
302300
}
303301
}
304302

305-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
306303
@usableFromInline
307304
enum _RetryExecutorTask<R: Sendable>: Sendable {
308305
case timedOut(Result<Void, any Error>)

0 commit comments

Comments
 (0)