aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/tools
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-07-27 11:11:32 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-07-27 11:11:32 -0700
commit0b316b041f9e26df523d47906705d10ff931191e (patch)
tree3a4b4e0a5681f1df97e4e4d9a88c6bd2986ea76b /src/ruby/tools
parentb51eeb58bd8e9575a744d9949d72326a1a8c6ea7 (diff)
Ruby Tools: automatically include plugin argument in protoc command
Diffstat (limited to 'src/ruby/tools')
-rwxr-xr-xsrc/ruby/tools/bin/grpc_tools_ruby_protoc.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb b/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb
index 3a2a5b8dc9..dab06e7958 100755
--- a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb
+++ b/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb
@@ -32,10 +32,17 @@ require 'rbconfig'
require_relative '../os_check'
-protoc_name = 'protoc' + RbConfig::CONFIG['EXEEXT']
+ext = RbConfig::CONFIG['EXEEXT']
-protoc_path = File.join(File.dirname(__FILE__),
- RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name,
- protoc_name)
+protoc_name = 'protoc' + ext
-exec([ protoc_path, protoc_path ], *ARGV)
+plugin_name = 'grpc_ruby_plugin' + ext
+
+protoc_dir = File.join(File.dirname(__FILE__),
+ RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name)
+
+protoc_path = File.join(protoc_dir, protoc_name)
+
+plugin_path = File.join(protoc_dir, plugin_name)
+
+exec([ protoc_path, protoc_path ], "--plugin=protoc-gen-grpc=#{plugin_path}", *ARGV)