diff --git a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj index ae45debd..3dde9b27 100644 --- a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj +++ b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj @@ -20,10 +20,10 @@ Licensed under the MIT license. See LICENSE file in the project root for full li - + - + diff --git a/tools/helper.psm1 b/tools/helper.psm1 index 5af17d4e..30f777b2 100644 --- a/tools/helper.psm1 +++ b/tools/helper.psm1 @@ -9,6 +9,8 @@ $IsWindowsEnv = [RuntimeInformation]::IsOSPlatform([OSPlatform]::Windows) $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path $MinimalSDKVersion = '3.1.1' $LocalDotnetDirPath = if ($IsWindowsEnv) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } +$GrpcToolsVersion = '2.27.0' # grpc.tools +$GoogleProtobufToolsVersion = '3.11.4' # google.protobuf.tools function Find-Dotnet { @@ -141,29 +143,24 @@ function Resolve-ProtoBufToolPath } $Script:protoc_Path = - Get-ChildItem "$nugetPath/grpc.tools/*/$protoc_Name" -Recurse | - Where-Object FullName -Like "*$plat_arch_Name*" | - Sort-Object -Property FullName -Descending | - Select-Object -First 1 | ForEach-Object FullName + Resolve-Path "$nugetPath/grpc.tools/$GrpcToolsVersion/tools/$plat_arch_Name/$protoc_Name" | + ForEach-Object Path if (-not $Script:protoc_Path) { throw "Couldn't find the executable 'protoc'. Check if the package 'grpc.tools' has been restored." } $Script:grpc_csharp_plugin_Path = - Get-ChildItem "$nugetPath/grpc.tools/*/$grpc_csharp_plugin_Name" -Recurse | - Where-Object FullName -Like "*$plat_arch_Name*" | - Sort-Object -Property FullName -Descending | - Select-Object -First 1 | ForEach-Object FullName + Resolve-Path "$nugetPath/grpc.tools/$GrpcToolsVersion/tools/$plat_arch_Name/$grpc_csharp_plugin_Name" | + ForEach-Object Path if (-not $Script:grpc_csharp_plugin_Path) { throw "Couldn't find the executable 'grpc_csharp_plugin'. Check if the package 'grpc.tools' has been restored." } $Script:google_protobuf_tools_Path = - Get-ChildItem "$nugetPath/google.protobuf.tools/*/tools" | - Sort-Object -Property FullName -Descending | - Select-Object -First 1 | ForEach-Object FullName + Resolve-Path "$nugetPath/google.protobuf.tools/$GoogleProtobufToolsVersion/tools" | + ForEach-Object Path if (-not $Script:google_protobuf_tools_Path) { throw "Couldn't find the protobuf tools. Check if the package 'google.protobuf.tools' has been restored." diff --git a/tools/protobuf.tools.csproj b/tools/protobuf.tools.csproj index 8e069cfe..f74bf36a 100644 --- a/tools/protobuf.tools.csproj +++ b/tools/protobuf.tools.csproj @@ -11,8 +11,8 @@ Licensed under the MIT license. See LICENSE file in the project root for full li - - + +