Skip to content

Commit

Permalink
Merge pull request grpc#7551 from murgatroid99/ruby_tools_plugin_arg
Browse files Browse the repository at this point in the history
Ruby Tools: automatically include plugin argument in protoc command
  • Loading branch information
nicolasnoble authored Jul 28, 2016
2 parents 92ebb5d + d8bc223 commit a062a7f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ruby/tools/bin/grpc_tools_ruby_protoc
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a062a7f

Please sign in to comment.