Skip to content

Commit 5a33c78

Browse files
committed
more review comments
1 parent 3d2e229 commit 5a33c78

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Sources/GRPCCore/Documentation.docc/Articles/Generating-stubs.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,11 @@ If you've used Protocol Buffers before then generating gRPC Swift stubs should b
88
unfamiliar with Protocol Buffers then you should get comfortable with the concepts before
99
continuing; the [Protocol Buffers website](https://protobuf.dev/) is a great place to start.
1010

11-
The [`grpc-swift-protobuf`](https://github.com/grpc/grpc-swift-protobuf) package provides
12-
`protoc-gen-grpc-swift`, a program which is a plugin for the Protocol Buffers compiler, `protoc`.
13-
1411
You can use the protoc plugin from the command line directly, or you can make use of a
1512
[Swift Package Manager build plugin](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Plugins.md)
1613
convenience which adds the stub generation to the Swift build graph.
1714
You may use the build plugin either from the command line or from Xcode.
1815

19-
20-
> `protoc-gen-grpc-swift` only generates gRPC stubs, it doesn't generate messages. You must use
21-
> `protoc-gen-swift` to generate messages in addition to gRPC Stubs.
22-
23-
24-
2516
## Using the build plugin
2617

2718
The build plugin (`GRPCProtobufGenerator`) is a great choice for convenient dynamic code generation, however it does come with some limitations.
@@ -104,13 +95,18 @@ lower in the file hierarchy supersedes one above it.
10495

10596
### Using protoc
10697

98+
The [`grpc-swift-protobuf`](https://github.com/grpc/grpc-swift-protobuf) package provides
99+
`protoc-gen-grpc-swift`, a program which is a plugin for the Protocol Buffers compiler, `protoc`.
107100
To generate gRPC stubs for your `.proto` files directly you must run the `protoc` command with
108101
the `--grpc-swift_out=<DIRECTORY>` option:
109102

110103
```console
111104
protoc --grpc-swift_out=. my-service.proto
112105
```
113106

107+
> `protoc-gen-grpc-swift` only generates gRPC stubs, it doesn't generate messages. You must use
108+
> `protoc-gen-swift` to generate messages in addition to gRPC Stubs.
109+
114110
The presence of `--grpc-swift_out` tells `protoc` to use the `protoc-gen-grpc-swift` plugin. By
115111
default it'll look for the plugin in your `PATH`. You can also specify the path to the plugin
116112
explicitly:

0 commit comments

Comments
 (0)