From 93ec77cb667107ace2374a9c3fa0566ff20f2c4f Mon Sep 17 00:00:00 2001 From: George Barnett Date: Wed, 21 May 2025 12:48:56 +0100 Subject: [PATCH] Rename package to grpc-swift-2 --- Examples/echo-metadata/Package.swift | 8 ++++---- Examples/echo/Package.swift | 8 ++++---- Examples/error-details/Package.swift | 8 ++++---- Examples/hello-world/Package.swift | 8 ++++---- Examples/reflection-server/Package.swift | 10 +++++----- Examples/route-guide/Package.swift | 8 ++++---- Examples/service-lifecycle/Package.swift | 10 +++++----- IntegrationTests/Benchmarks/Package.swift | 2 +- Package.swift | 4 ++-- README.md | 20 +++++++++++-------- Sources/GRPCCodeGen/CodeGenerator.swift | 3 --- .../GRPCCore/Call/Client/ClientResponse.swift | 1 - .../GRPCCore/Call/Server/ServerContext.swift | 2 -- .../Articles/Migration-guide.md | 14 ++++++------- ...route-guide-sec01-step07-description.swift | 6 +++--- ...route-guide-sec01-step08-description.swift | 8 ++++---- .../route-guide-sec01-step09-plugin.swift | 8 ++++---- ...oute-guide-sec03-step01-protoc-plugins.txt | 2 +- .../route-guide-sec03-step04-gen-grpc.txt | 2 +- .../route-guide-sec05-step00-package.swift | 8 ++++---- .../route-guide-sec05-step01-package.swift | 8 ++++---- .../route-guide-sec05-step02-package.swift | 8 ++++---- dev/grpc-dev-tool/Package.swift | 2 +- dev/protos/generate.sh | 4 ++-- dev/v1-to-v2/v1_to_v2.sh | 4 ++-- 25 files changed, 82 insertions(+), 84 deletions(-) diff --git a/Examples/echo-metadata/Package.swift b/Examples/echo-metadata/Package.swift index e19ab6ef..2254f9c7 100644 --- a/Examples/echo-metadata/Package.swift +++ b/Examples/echo-metadata/Package.swift @@ -21,16 +21,16 @@ let package = Package( name: "echo-metadata", platforms: [.macOS("15.0")], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), ], targets: [ .executableTarget( name: "echo-metadata", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "ArgumentParser", package: "swift-argument-parser"), diff --git a/Examples/echo/Package.swift b/Examples/echo/Package.swift index 6705a8b1..a0d081ae 100644 --- a/Examples/echo/Package.swift +++ b/Examples/echo/Package.swift @@ -21,16 +21,16 @@ let package = Package( name: "echo", platforms: [.macOS("15.0")], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), ], targets: [ .executableTarget( name: "echo", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "ArgumentParser", package: "swift-argument-parser"), diff --git a/Examples/error-details/Package.swift b/Examples/error-details/Package.swift index b2f15c72..bfc0ad97 100644 --- a/Examples/error-details/Package.swift +++ b/Examples/error-details/Package.swift @@ -21,15 +21,15 @@ let package = Package( name: "error-details", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "error-details", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), - .product(name: "GRPCInProcessTransport", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), + .product(name: "GRPCInProcessTransport", package: "grpc-swift-2"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ], plugins: [ diff --git a/Examples/hello-world/Package.swift b/Examples/hello-world/Package.swift index daa71a57..76c69e84 100644 --- a/Examples/hello-world/Package.swift +++ b/Examples/hello-world/Package.swift @@ -21,16 +21,16 @@ let package = Package( name: "hello-world", platforms: [.macOS("15.0")], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), ], targets: [ .executableTarget( name: "hello-world", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "ArgumentParser", package: "swift-argument-parser"), diff --git a/Examples/reflection-server/Package.swift b/Examples/reflection-server/Package.swift index 4361c689..cfe73032 100644 --- a/Examples/reflection-server/Package.swift +++ b/Examples/reflection-server/Package.swift @@ -21,17 +21,17 @@ let package = Package( name: "reflection-server", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-extras.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-extras.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), ], targets: [ .executableTarget( name: "reflection-server", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "GRPCReflectionService", package: "grpc-swift-extras"), diff --git a/Examples/route-guide/Package.swift b/Examples/route-guide/Package.swift index b4a9589f..d69f0f0f 100644 --- a/Examples/route-guide/Package.swift +++ b/Examples/route-guide/Package.swift @@ -21,16 +21,16 @@ let package = Package( name: "route-guide", platforms: [.macOS("15.0")], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), ], targets: [ .executableTarget( name: "route-guide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "ArgumentParser", package: "swift-argument-parser"), diff --git a/Examples/service-lifecycle/Package.swift b/Examples/service-lifecycle/Package.swift index c2d239c2..5bef5199 100644 --- a/Examples/service-lifecycle/Package.swift +++ b/Examples/service-lifecycle/Package.swift @@ -21,16 +21,16 @@ let package = Package( name: "service-lifecycle", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-extras", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-extras.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "service-lifecycle", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), - .product(name: "GRPCInProcessTransport", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), + .product(name: "GRPCInProcessTransport", package: "grpc-swift-2"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "GRPCServiceLifecycle", package: "grpc-swift-extras"), ], diff --git a/IntegrationTests/Benchmarks/Package.swift b/IntegrationTests/Benchmarks/Package.swift index 3fe8b8ae..4269788f 100644 --- a/IntegrationTests/Benchmarks/Package.swift +++ b/IntegrationTests/Benchmarks/Package.swift @@ -30,7 +30,7 @@ let package = Package( name: "GRPCSwiftBenchmark", dependencies: [ .product(name: "Benchmark", package: "package-benchmark"), - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), ], path: "Benchmarks/GRPCSwiftBenchmark", plugins: [ diff --git a/Package.swift b/Package.swift index 0b1839e2..1d011cef 100644 --- a/Package.swift +++ b/Package.swift @@ -50,7 +50,7 @@ let dependencies: [Package.Dependency] = [ // This adds some build settings which allow us to map "@available(gRPCSwift 2.x, *)" to // the appropriate OS platforms. -let nextMinorVersion = 2 +let nextMinorVersion = 1 let availabilitySettings: [SwiftSetting] = (0 ... nextMinorVersion).map { minor in let name = "gRPCSwift" let version = "2.\(minor)" @@ -123,7 +123,7 @@ let targets: [Target] = [ ] let package = Package( - name: "grpc-swift", + name: "grpc-swift-2", products: products, dependencies: dependencies, targets: targets diff --git a/README.md b/README.md index a6ea9c73..42ed84fd 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,13 @@ about gRPC on the [gRPC project's website][grpcio]. - 🪪 **License** is Apache 2.0, repeated in [LICENSE](License) - 🔒 **Security** issues should be reported via the process in [SECURITY.md](SECURITY.md) - 🔀 **Related Repositories**: - - [`grpc-swift-nio-transport`][grpc-swift-nio-transport] contains high-performance HTTP/2 client and server transport implementations for gRPC Swift built on top of SwiftNIO. - - [`grpc-swift-protobuf`][grpc-swift-protobuf] contains integrations with SwiftProtobuf for gRPC Swift. - - [`grpc-swift-extras`][grpc-swift-extras] contains optional extras for gRPC Swift. + - [`grpc-swift-nio-transport`][grpc-swift-nio-transport] contains + high-performance HTTP/2 client and server transport implementations for gRPC + Swift built on top of SwiftNIO. + - [`grpc-swift-protobuf`][grpc-swift-protobuf] contains integrations with + SwiftProtobuf for gRPC Swift. + - [`grpc-swift-extras`][grpc-swift-extras] contains optional extras for gRPC + Swift. ## Quick Start @@ -27,15 +31,15 @@ let package = Package( name: "Application", platforms: [.macOS("15.0")], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "Server", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ] @@ -46,7 +50,7 @@ let package = Package( [gh-grpc]: https://github.com/grpc/grpc [grpcio]: https://grpc.io -[spi-grpc-swift]: https://swiftpackageindex.com/grpc/grpc-swift/documentation +[spi-grpc-swift]: https://swiftpackageindex.com/grpc/grpc-swift-2/documentation [grpc-swift-nio-transport]: https://github.com/grpc/grpc-swift-nio-transport [grpc-swift-protobuf]: https://github.com/grpc/grpc-swift-protobuf [grpc-swift-extras]: https://github.com/grpc/grpc-swift-extras diff --git a/Sources/GRPCCodeGen/CodeGenerator.swift b/Sources/GRPCCodeGen/CodeGenerator.swift index 56de6efc..64c7bb13 100644 --- a/Sources/GRPCCodeGen/CodeGenerator.swift +++ b/Sources/GRPCCodeGen/CodeGenerator.swift @@ -43,10 +43,8 @@ public struct CodeGenerator: Sendable { /// Whether or not server code should be generated. public var server: Bool /// The name of the core gRPC module. - @available(gRPCSwift 2.1, *) public var grpcCoreModuleName: String /// The availability annotations to use on the generated code. - @available(gRPCSwift 2.2, *) public var availability: AvailabilityAnnotations = .default /// Creates a new configuration. @@ -92,7 +90,6 @@ public struct CodeGenerator: Sendable { } // The availability that generated code is annotated with. - @available(gRPCSwift 2.2, *) public struct AvailabilityAnnotations: Sendable, Hashable { public struct Platform: Sendable, Hashable { /// The name of the OS, e.g. 'macOS'. diff --git a/Sources/GRPCCore/Call/Client/ClientResponse.swift b/Sources/GRPCCore/Call/Client/ClientResponse.swift index 23ec3854..706451bc 100644 --- a/Sources/GRPCCore/Call/Client/ClientResponse.swift +++ b/Sources/GRPCCore/Call/Client/ClientResponse.swift @@ -390,7 +390,6 @@ extension StreamingClientResponse { /// Returns the body parts (i.e. `messages` and `trailingMetadata`) returned from the server. /// /// For rejected RPCs (in other words, where ``accepted`` is `failure`), the `RPCAsyncSequence` throws a ``RPCError``. - @available(gRPCSwift 2.1, *) public var bodyParts: RPCAsyncSequence { switch self.accepted { case let .success(contents): diff --git a/Sources/GRPCCore/Call/Server/ServerContext.swift b/Sources/GRPCCore/Call/Server/ServerContext.swift index 6df188f1..548b2096 100644 --- a/Sources/GRPCCore/Call/Server/ServerContext.swift +++ b/Sources/GRPCCore/Call/Server/ServerContext.swift @@ -19,7 +19,6 @@ public struct ServerContext: Sendable { /// Protocol used to help identify transport specific context fields - @available(gRPCSwift 2.2, *) public protocol TransportSpecific: Sendable {} /// A description of the method being called. @@ -58,7 +57,6 @@ public struct ServerContext: Sendable { /// /// An example of what this field can be used for, would be to store /// things like a peer certificate from a mTLS connection - @available(gRPCSwift 2.2, *) public var transportSpecific: (any TransportSpecific)? /// A handle for checking the cancellation status of an RPC. diff --git a/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md b/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md index 493061ef..c2960a11 100644 --- a/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md +++ b/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md @@ -66,8 +66,8 @@ you've finished the migration. Now you need to update your package manifest (`Package.swift`) to use the local copy rather than the copy from GitHub. Replace your package dependency on -"grpc-swift" with the local dependency, and update any target dependencies to -use "grpc-swift-v1" instead of "grpc-swift": +"grpc-swift-2" with the local dependency, and update any target dependencies to +use "grpc-swift-v1" instead of "grpc-swift-2": ```swift let package = Package( @@ -130,16 +130,16 @@ If there are any other build issues fix them up now and commit the changes. Now add the following package dependencies for gRPC Swift 2.x: ``` -.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), -.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), -.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), +.package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), +.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), +.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ``` For each target which was previously importing the `GRPC` module add the following target dependencies: ``` -.product(name: "GRPCCore", package: "grpc-swift"), +.product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), ``` @@ -175,7 +175,7 @@ directory containing your generated code, for example: One of the patches applied to the local copy of 1.x was to rename `protoc-gen-grpc-swift` to `protoc-gen-grpc-swift-v1`. If you previously used a script to generate your code, then run it again, ensuring that the copy of -`protoc-gen-grpc-swift` comes from this package (as it will now be for 2.x). +`protoc-gen-grpc-swift-2` comes from this package (as it will now be for 2.x). If you didn't use a script to generate your code then refer to the [documentation][3] to learn how to generate gRPC Swift code. diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step07-description.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step07-description.swift index e30951ef..8ce5cc21 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step07-description.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step07-description.swift @@ -5,9 +5,9 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ], targets: [] ) diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step08-description.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step08-description.swift index 0fe74355..fdc0f217 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step08-description.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step08-description.swift @@ -5,15 +5,15 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "RouteGuide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ] diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step09-plugin.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step09-plugin.swift index 42791560..af46ca50 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step09-plugin.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec01-step09-plugin.swift @@ -5,15 +5,15 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "RouteGuide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ], diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step01-protoc-plugins.txt b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step01-protoc-plugins.txt index 4eabab72..3228d117 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step01-protoc-plugins.txt +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step01-protoc-plugins.txt @@ -1,2 +1,2 @@ $ swift build --product protoc-gen-swift -$ swift build --product protoc-gen-grpc-swift +$ swift build --product protoc-gen-grpc-swift-2 diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step04-gen-grpc.txt b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step04-gen-grpc.txt index 89d320b6..44f57dcc 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step04-gen-grpc.txt +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec03-step04-gen-grpc.txt @@ -1,4 +1,4 @@ -$ protoc --plugin=.build/debug/protoc-gen-grpc-swift \ +$ protoc --plugin=.build/debug/protoc-gen-grpc-swift-2 \ -I Protos \ --grpc-swift_out=Sources/Generated \ Protos/route_guide.proto diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step00-package.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step00-package.swift index 42791560..af46ca50 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step00-package.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step00-package.swift @@ -5,15 +5,15 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "RouteGuide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ], diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step01-package.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step01-package.swift index 757d9910..ec798f6f 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step01-package.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step01-package.swift @@ -5,15 +5,15 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), ], targets: [ .executableTarget( name: "RouteGuide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), ], diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step02-package.swift b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step02-package.swift index 89ace64d..c0e87da4 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step02-package.swift +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Resources/route-guide-sec05-step02-package.swift @@ -5,16 +5,16 @@ let package = Package( name: "RouteGuide", platforms: [.macOS(.v15)], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"), ], targets: [ .executableTarget( name: "RouteGuide", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift-2"), .product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"), .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), .product(name: "ArgumentParser", package: "swift-argument-parser"), diff --git a/dev/grpc-dev-tool/Package.swift b/dev/grpc-dev-tool/Package.swift index 8f8d3f89..f8ddc1a9 100644 --- a/dev/grpc-dev-tool/Package.swift +++ b/dev/grpc-dev-tool/Package.swift @@ -28,7 +28,7 @@ let package = Package( .executableTarget( name: "grpc-dev-tool", dependencies: [ - .product(name: "GRPCCodeGen", package: "grpc-swift"), + .product(name: "GRPCCodeGen", package: "grpc-swift-2"), .product(name: "ArgumentParser", package: "swift-argument-parser"), ] ) diff --git a/dev/protos/generate.sh b/dev/protos/generate.sh index a4409f1d..3e648b4d 100755 --- a/dev/protos/generate.sh +++ b/dev/protos/generate.sh @@ -23,12 +23,12 @@ protoc=$(which protoc) build_dir=$(mktemp -d) git clone https://github.com/grpc/grpc-swift-protobuf --depth 1 "$build_dir" swift build --package-path "$build_dir" --product protoc-gen-swift -swift build --package-path "$build_dir" --product protoc-gen-grpc-swift +swift build --package-path "$build_dir" --product protoc-gen-grpc-swift-2 # Grab the plugin paths. bin_path=$(swift build --package-path "$build_dir" --show-bin-path) protoc_gen_swift="$bin_path/protoc-gen-swift" -protoc_gen_grpc_swift="$bin_path/protoc-gen-grpc-swift" +protoc_gen_grpc_swift="$bin_path/protoc-gen-grpc-swift-2" # Generates gRPC by invoking protoc with the gRPC Swift plugin. # Parameters: diff --git a/dev/v1-to-v2/v1_to_v2.sh b/dev/v1-to-v2/v1_to_v2.sh index c1901ed2..2d60fbc5 100755 --- a/dev/v1-to-v2/v1_to_v2.sh +++ b/dev/v1-to-v2/v1_to_v2.sh @@ -32,7 +32,7 @@ function checkout_v1 { log "Cloning grpc-swift to ${grpc_checkout_path}" git clone \ --quiet \ - https://github.com/grpc/grpc-swift.git \ + https://github.com/grpc/grpc-swift-2.git \ "${grpc_checkout_path}" # Get the latest version of 1.x.y. @@ -49,7 +49,7 @@ function checkout_v1 { package_manifest="${grpc_checkout_path}/Package.swift" log "Updating ${package_manifest}" sed -i '' \ - -e 's/let grpcPackageName = "grpc-swift"/let grpcPackageName = "grpc-swift-v1"/g' \ + -e 's/let grpcPackageName = "grpc-swift-2"/let grpcPackageName = "grpc-swift-v1"/g' \ -e 's/protoc-gen-grpc-swift/protoc-gen-grpc-swift-v1/g' \ "${package_manifest}"