Browse Source

Merge pull request #36 from acchou/master

Explicitly specify protoc plugin in Plugin test target
Tim Burks 8 years ago
parent
commit
574c47b6a3
3 changed files with 12 additions and 4 deletions
  1. 4 0
      .gitignore
  2. 1 1
      Plugin/Makefile
  3. 7 3
      Plugin/README.md

+ 4 - 0
.gitignore

@@ -3,3 +3,7 @@ project.xcworkspace
 xcuserdata
 xcuserdata
 .build
 .build
 third_party/**
 third_party/**
+Plugin/Packages/**
+Plugin/protoc-*
+Plugin/swiftgrpc.log
+Plugin/echo.*.swift

+ 1 - 1
Plugin/Makefile

@@ -9,7 +9,7 @@ build:  clear
 	cp .build/debug/protoc-gen-swift .
 	cp .build/debug/protoc-gen-swift .
 
 
 test:	build
 test:	build
-	protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --swiftgrpc_out=. 
+	protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --plugin=./protoc-gen-swiftgrpc --swiftgrpc_out=. 
 	diff echo.client.pb.swift ../Examples/Echo/Generated/echo.client.pb.swift
 	diff echo.client.pb.swift ../Examples/Echo/Generated/echo.client.pb.swift
 	diff echo.server.pb.swift ../Examples/Echo/Generated/echo.server.pb.swift
 	diff echo.server.pb.swift ../Examples/Echo/Generated/echo.server.pb.swift
 
 

+ 7 - 3
Plugin/README.md

@@ -6,11 +6,15 @@ the Protocol Buffer Compiler.
 It is built with the Swift Package Manager and the included
 It is built with the Swift Package Manager and the included
 Makefile. The resulting binary is named `protoc-gen-swiftgrpc`
 Makefile. The resulting binary is named `protoc-gen-swiftgrpc`
 and can be called from `protoc` by adding the `--swiftgrpc_out`
 and can be called from `protoc` by adding the `--swiftgrpc_out`
-command-line option. For example, here's an invocation from
-the Makefile:
+command-line option and `--plugin` option. For example, here's an
+invocation from the Makefile:
 
 
-	protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --swiftgrpc_out=. 
+		protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --plugin=./protoc-gen-swiftgrpc --swiftgrpc_out=.
 
 
 The plugin uses template files in the [Templates](Templates) directory. 
 The plugin uses template files in the [Templates](Templates) directory. 
 These files are compiled into the `protoc-gen-swiftgrpc` plugin executable.
 These files are compiled into the `protoc-gen-swiftgrpc` plugin executable.
 
 
+The Swift gRPC plugin can be installed by placing the
+`protoc-gen-swiftgrpc` binary into one of the directories in your
+path.  Specifying `--swiftgrpc_out` to `protoc` will automatically
+search the `PATH` environment variable for this binary.