Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Updating gen-proto script to use os specific proto compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
BugDiver committed Jan 16, 2017
1 parent 7c985f2 commit eb64b4d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build/gen-proto.ps1
Expand Up @@ -17,9 +17,7 @@
$protocEx
$grpcEx

$is_64_bit = (Get-WmiObject -Class Win32_ComputerSystem).SystemType -match "(x64)"

if ($is_64_bit){
if ((gci Env:PROCESSOR_ARCHITECTURE).value -match 64){
$protocEx = gci .\packages\Grpc.Tools\tools\windows_x64 -Filter protoc.exe -recurse
$grpcEx=gci .\packages\Grpc.Tools\tools\windows_x64 -Filter grpc_csharp_plugin.exe -recurse
}
Expand All @@ -34,8 +32,9 @@ $grpc="$($grpcEx.FullName)"

Write-Host "Generating Proto Classes.."

$args = @('-I.\gauge-proto', '--csharp_out=.\Core', '--grpc_out=.\Core', '*.proto', "--plugin=protoc-gen-grpc=$grpc")

&$protoc $args
gci ".\gauge-proto" -Filter "*.proto" | %{
Write-Host "Generating classes for $_"
&$protoc @('-I.\gauge-proto', '--csharp_out=.\Core', '--grpc_out=.\Core', ".\gauge-proto\$_", "--plugin=protoc-gen-grpc=$grpc")
}

Write-Host "Done!"

0 comments on commit eb64b4d

Please sign in to comment.