Skip to content

Commit 37922f1

Browse files
committed
Add rudimentary installation instructions to plugin
Describe how `protoc` finds the plugin binary in the path. A simple installation can be performed by copying the binary to a directory in the path. Also fix the example `protoc` invocation to match the Makefile by adding an explicit `--plugin` argument. Also add a few more files to .gitignore that are generated during plugin build/test.
1 parent c8394bd commit 37922f1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ xcuserdata
55
third_party/**
66
Plugin/Packages/**
77
Plugin/protoc-*
8+
Plugin/swiftgrpc.log
9+
Plugin/echo.*.swift

Plugin/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ the Protocol Buffer Compiler.
66
It is built with the Swift Package Manager and the included
77
Makefile. The resulting binary is named `protoc-gen-swiftgrpc`
88
and can be called from `protoc` by adding the `--swiftgrpc_out`
9-
command-line option. For example, here's an invocation from
10-
the Makefile:
9+
command-line option and `--plugin` option. For example, here's an
10+
invocation from the Makefile:
1111

12-
protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --swiftgrpc_out=.
12+
protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --plugin=./protoc-gen-swiftgrpc --swiftgrpc_out=.
1313

1414
The plugin uses template files in the [Templates](Templates) directory.
1515
These files are compiled into the `protoc-gen-swiftgrpc` plugin executable.
1616

17+
The Swift gRPC plugin can be installed by placing the
18+
`protoc-gen-swiftgrpc` binary into one of the directories in your
19+
path. Specifying `--swiftgrpc_out` to `protoc` will automatically
20+
search the `PATH` environment variable for this binary.

0 commit comments

Comments
 (0)