run_distrib_test_dotnetcli.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Copyright 2015 gRPC authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -ex
  16. cd "$(dirname "$0")"
  17. unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_windows_dotnetcli.zip" -d TestNugetFeed
  18. ./update_version.sh auto
  19. cd DistribTest
  20. # TODO(jtattermusch): make sure we don't pollute the global nuget cache with
  21. # the nugets being tested.
  22. dotnet restore DistribTestDotNet.csproj
  23. dotnet build DistribTestDotNet.csproj
  24. ls -R bin
  25. if [ "${SKIP_NET45_DISTRIBTEST}" != "1" ]
  26. then
  27. dotnet publish -f net45 DistribTestDotNet.csproj
  28. # .NET 4.5 target after dotnet build
  29. mono bin/Debug/net45/publish/DistribTestDotNet.exe
  30. # .NET 4.5 target after dotnet publish
  31. mono bin/Debug/net45/publish/DistribTestDotNet.exe
  32. fi
  33. if [ "${SKIP_NETCOREAPP21_DISTRIBTEST}" != "1" ]
  34. then
  35. dotnet publish -f netcoreapp2.1 DistribTestDotNet.csproj
  36. # .NET Core target after dotnet build
  37. dotnet exec bin/Debug/netcoreapp2.1/DistribTestDotNet.dll
  38. # .NET Core target after dotnet publish
  39. dotnet exec bin/Debug/netcoreapp2.1/publish/DistribTestDotNet.dll
  40. fi
  41. if [ "${SKIP_NETCOREAPP31_DISTRIBTEST}" != "1" ]
  42. then
  43. dotnet publish -f netcoreapp3.1 DistribTestDotNet.csproj
  44. # .NET Core target after dotnet build
  45. dotnet exec bin/Debug/netcoreapp3.1/DistribTestDotNet.dll
  46. # .NET Core target after dotnet publish
  47. dotnet exec bin/Debug/netcoreapp3.1/publish/DistribTestDotNet.dll
  48. fi
  49. if [ "${SKIP_NET50_DISTRIBTEST}" != "1" ]
  50. then
  51. dotnet publish -f net5.0 DistribTestDotNet.csproj
  52. dotnet publish -r linux-x64 -f net5.0 DistribTestDotNet.csproj -p:PublishSingleFile=true --self-contained true --output net5_singlefile_publish
  53. # .NET Core target after dotnet build
  54. dotnet exec bin/Debug/net5.0/DistribTestDotNet.dll
  55. # .NET Core target after dotnet publish
  56. dotnet exec bin/Debug/net5.0/publish/DistribTestDotNet.dll
  57. # binary generated by the single file publish
  58. ./net5_singlefile_publish/DistribTestDotNet
  59. fi