-
Notifications
You must be signed in to change notification settings - Fork 424
Update tutorials to use the build plugin #2178
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
Conversation
Motivation: The examples have been updated to use the build plugin; so too should the tutorials. Modifications: Update tutorials to use the build plugin. Result: Better tutorials.
@Steps { | ||
@Step { | ||
In a terminal run `swift run hello-world serve` to start the server. By default it'll start | ||
listening on port 31415. | ||
In a terminal run `PROTOC_PATH=$(which protoc) swift run hello-world serve` to start the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explain why PROTOC_PATH
is needed and/or link to the plugin docs that explain it in more detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a great point, I'll do that.
|
||
@Code(name: "Protos/route_guide.proto", file: "route-guide-sec02-step01-import.proto") | ||
It's good practice to organise your `.proto` files according to the package they are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should we stick to American spelling (organise vs organize)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should. (Sadly.)
You may notices that the `swift` commands are all prefixed with `PROTOC_PATH=$(which protoc)`, | ||
this is to let the build system know where `protoc` is located so that it can generate stubs | ||
for you. You can read more about it in the [gRPC Swift Protobuf | ||
documentation](https://swiftpackageindex.com/grpc/grpc-swift-protobuf/documentation/grpcprotobuf/generating-stubs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is a pre-emptive change: I think we should move the generating stubs doc to the protobuf package and then link to it from the core package docs.
Motivation:
The examples have been updated to use the build plugin; so too should the tutorials.
Modifications:
Update tutorials to use the build plugin.
Result:
Better tutorials.