Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
e.g.
swift package generate-grpc-code-from-protos Sources/Protos/HelloWorld.proto
This PR also includes a change to
protoc-gen-grpc-swift
itself:protoc-gen-swift
. A separate PR togrpc-swift
makes these files more clearly intentional.Build Plugin
The SwiftPM build plugin will locate protobuf files in the
Sources
directory (with the extension.proto
) and attempt to invoke both theprotoc-gen-swift
andprotoc-gen-grpc-swift
protoc
plugins on them to automatically generate Swift source. Behavior can be modified by specifying one or more configuration files (namedgrpc-swift-config.json
).Configuration
Adoption
Users must add the plugin to any target which wishes to make use of it
Command Plugin
protoc
invocations it uses for ease of debugging. The--dry-run
flag can be supplied for this purpose or so that they may be extracted and used separately e.g. in a script.protoc
path is supplied then SwiftPM will attempt to locate it.output
directory is supplied then generated files are placed in the working directory.