Debian Codegraph @

test/distrib/csharp/run_distrib_test_dotnetcli.sh

raw
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
16 set -ex
17
18 cd "$(dirname "$0")"
19
20 unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_windows_dotnetcli.zip" -d TestNugetFeed
21
22 ./update_version.sh auto
23
24 cd DistribTest
25
26 # TODO(jtattermusch): make sure we don't pollute the global nuget cache with
27 # the nugets being tested.
28 dotnet restore DistribTestDotNet.csproj
29
30 dotnet build DistribTestDotNet.csproj
31
32 ls -R bin
33
34 if [ "${SKIP_NET45_DISTRIBTEST}" != "1" ]
35 then
36 dotnet publish -f net45 DistribTestDotNet.csproj
37
38 # .NET 4.5 target after dotnet build
39 mono bin/Debug/net45/publish/DistribTestDotNet.exe
40
41 # .NET 4.5 target after dotnet publish
42 mono bin/Debug/net45/publish/DistribTestDotNet.exe
43 fi
44
45 if [ "${SKIP_NETCOREAPP21_DISTRIBTEST}" != "1" ]
46 then
47 dotnet publish -f netcoreapp2.1 DistribTestDotNet.csproj
48
49 # .NET Core target after dotnet build
50 dotnet exec bin/Debug/netcoreapp2.1/DistribTestDotNet.dll
51
52 # .NET Core target after dotnet publish
53 dotnet exec bin/Debug/netcoreapp2.1/publish/DistribTestDotNet.dll
54 fi
55
56 if [ "${SKIP_NETCOREAPP31_DISTRIBTEST}" != "1" ]
57 then
58 dotnet publish -f netcoreapp3.1 DistribTestDotNet.csproj
59
60 # .NET Core target after dotnet build
61 dotnet exec bin/Debug/netcoreapp3.1/DistribTestDotNet.dll
62
63 # .NET Core target after dotnet publish
64 dotnet exec bin/Debug/netcoreapp3.1/publish/DistribTestDotNet.dll
65 fi
66
67 if [ "${SKIP_NET50_DISTRIBTEST}" != "1" ]
68 then
69 dotnet publish -f net5.0 DistribTestDotNet.csproj
70
71 dotnet publish -r linux-x64 -f net5.0 DistribTestDotNet.csproj -p:PublishSingleFile=true --self-contained true --output net5_singlefile_publish
72
73 # .NET Core target after dotnet build
74 dotnet exec bin/Debug/net5.0/DistribTestDotNet.dll
75
76 # .NET Core target after dotnet publish
77 dotnet exec bin/Debug/net5.0/publish/DistribTestDotNet.dll
78
79 # binary generated by the single file publish
80 ./net5_singlefile_publish/DistribTestDotNet
81 fi