@@ -10,6 +10,8 @@ $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path
10
10
$MinimalSDKVersion = ' 2.1.805'
11
11
$DefaultSDKVersion = ' 2.1.805'
12
12
$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
13
15
14
16
function Find-Dotnet
15
17
{
@@ -150,29 +152,24 @@ function Resolve-ProtoBufToolPath
150
152
}
151
153
152
154
$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
157
157
158
158
if (-not $Script :protoc_Path ) {
159
159
throw " Couldn't find the executable 'protoc'. Check if the package 'grpc.tools' has been restored."
160
160
}
161
161
162
162
$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
167
165
168
166
if (-not $Script :grpc_csharp_plugin_Path ) {
169
167
throw " Couldn't find the executable 'grpc_csharp_plugin'. Check if the package 'grpc.tools' has been restored."
170
168
}
171
169
172
170
$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
176
173
177
174
if (-not $Script :google_protobuf_tools_Path ) {
178
175
throw " Couldn't find the protobuf tools. Check if the package 'google.protobuf.tools' has been restored."
0 commit comments