@@ -10,6 +10,8 @@ $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path
1010$MinimalSDKVersion = ' 2.1.805'
1111$DefaultSDKVersion = ' 2.1.805'
1212$LocalDotnetDirPath = if ($IsWindowsEnv ) { " $env: LocalAppData \Microsoft\dotnet" } else { " $env: HOME /.dotnet" }
13+ $GrpcToolsVersion = ' 2.27.0' # grpc.tools
14+ $GoogleProtobufToolsVersion = ' 3.11.4' # google.protobuf.tools
1315
1416function Find-Dotnet
1517{
@@ -150,29 +152,24 @@ function Resolve-ProtoBufToolPath
150152 }
151153
152154 $Script :protoc_Path =
153- Get-ChildItem " $nugetPath /grpc.tools/*/$protoc_Name " - Recurse |
154- Where-Object FullName -Like " *$plat_arch_Name *" |
155- Sort-Object - Property FullName - Descending |
156- Select-Object - First 1 | ForEach-Object FullName
155+ Resolve-Path " $nugetPath /grpc.tools/$GrpcToolsVersion /tools/$plat_arch_Name /$protoc_Name " |
156+ ForEach-Object Path
157157
158158 if (-not $Script :protoc_Path ) {
159159 throw " Couldn't find the executable 'protoc'. Check if the package 'grpc.tools' has been restored."
160160 }
161161
162162 $Script :grpc_csharp_plugin_Path =
163- Get-ChildItem " $nugetPath /grpc.tools/*/$grpc_csharp_plugin_Name " - Recurse |
164- Where-Object FullName -Like " *$plat_arch_Name *" |
165- Sort-Object - Property FullName - Descending |
166- Select-Object - First 1 | ForEach-Object FullName
163+ Resolve-Path " $nugetPath /grpc.tools/$GrpcToolsVersion /tools/$plat_arch_Name /$grpc_csharp_plugin_Name " |
164+ ForEach-Object Path
167165
168166 if (-not $Script :grpc_csharp_plugin_Path ) {
169167 throw " Couldn't find the executable 'grpc_csharp_plugin'. Check if the package 'grpc.tools' has been restored."
170168 }
171169
172170 $Script :google_protobuf_tools_Path =
173- Get-ChildItem " $nugetPath /google.protobuf.tools/*/tools" |
174- Sort-Object - Property FullName - Descending |
175- Select-Object - First 1 | ForEach-Object FullName
171+ Resolve-Path " $nugetPath /google.protobuf.tools/$GoogleProtobufToolsVersion /tools" |
172+ ForEach-Object Path
176173
177174 if (-not $Script :google_protobuf_tools_Path ) {
178175 throw " Couldn't find the protobuf tools. Check if the package 'google.protobuf.tools' has been restored."
0 commit comments