diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2018-05-18 16:08:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 16:08:54 -0700 |
commit | f2979e32185804ee707ab18da844d74496aeb479 (patch) | |
tree | 6b6654b973b951dcf030d0b11d1fa44a2a9d8770 /test/distrib | |
parent | bec3b5ada2c5e5d782dff0b7b5018df646b65cb0 (diff) | |
parent | 47cf9906c75cf82f6e70eb7b5814df26d9fa6f36 (diff) |
Merge pull request #15388 from jtattermusch/backport_15331
update C# distribtests (backport to v1.12.x)
Diffstat (limited to 'test/distrib')
-rw-r--r-- | test/distrib/csharp/DistribTest/DistribTest.project.json | 11 | ||||
-rw-r--r-- | test/distrib/csharp/DistribTest/DistribTestDotNet.csproj | 27 | ||||
-rw-r--r-- | test/distrib/csharp/DistribTest/project.json | 22 | ||||
-rwxr-xr-x | test/distrib/csharp/run_distrib_test.sh | 5 | ||||
-rwxr-xr-x | test/distrib/csharp/run_distrib_test_dotnetcli.sh | 17 | ||||
-rwxr-xr-x | test/distrib/csharp/update_version.sh | 2 |
6 files changed, 38 insertions, 46 deletions
diff --git a/test/distrib/csharp/DistribTest/DistribTest.project.json b/test/distrib/csharp/DistribTest/DistribTest.project.json deleted file mode 100644 index 422545ea8f..0000000000 --- a/test/distrib/csharp/DistribTest/DistribTest.project.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file exists only to prevent VS2015 from mistakenly picking up -// project.json file when building .csproj project. -// See https://github.com/Microsoft/msbuild/issues/394 -{ - "frameworks": { - "net45": { } - }, - "runtimes": { - "win": { } - } -} diff --git a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj new file mode 100644 index 0000000000..f16a0f9959 --- /dev/null +++ b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj @@ -0,0 +1,27 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFrameworks>netcoreapp1.0;net45</TargetFrameworks> + <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> + <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> + <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute> + <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute> + <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> + <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute> + <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Grpc" Version="__GRPC_NUGET_VERSION__" /> + <PackageReference Include="Grpc.Auth" Version="__GRPC_NUGET_VERSION__" /> + <PackageReference Include="Grpc.Tools" Version="__GRPC_NUGET_VERSION__" /> + </ItemGroup> + + <PropertyGroup Condition="'$(OS)' != 'Windows_NT'"> + <!-- Workaround for https://github.com/dotnet/sdk/issues/335 --> + <FrameworkPathOverride Condition="Exists('/usr/lib/mono/4.5-api')">/usr/lib/mono/4.5-api</FrameworkPathOverride> + <FrameworkPathOverride Condition="Exists('/usr/local/lib/mono/4.5-api')">/usr/local/lib/mono/4.5-api</FrameworkPathOverride> + <FrameworkPathOverride Condition="Exists('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api</FrameworkPathOverride> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/test/distrib/csharp/DistribTest/project.json b/test/distrib/csharp/DistribTest/project.json deleted file mode 100644 index 09266e5d4d..0000000000 --- a/test/distrib/csharp/DistribTest/project.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Grpc.Auth": "__GRPC_NUGET_VERSION__", - "Grpc.Core": "__GRPC_NUGET_VERSION__", - // Necessary for native deps to get copied correctly. - "Microsoft.NETCore.Platforms": "1.0.1" - }, - "frameworks": { - "net45": { }, - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - } - } - } - } -} diff --git a/test/distrib/csharp/run_distrib_test.sh b/test/distrib/csharp/run_distrib_test.sh index b96872725e..eee24d0e57 100755 --- a/test/distrib/csharp/run_distrib_test.sh +++ b/test/distrib/csharp/run_distrib_test.sh @@ -21,11 +21,6 @@ unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_windows_dotnetcli.zip ./update_version.sh auto -# With a recent-enough version of mono, the "nuget restore" command would -# restore packages based on project.json files, but we want to restore packages -# based on the net45 legacy "packages.config" file instead. -rm DistribTest/*project.json - nuget restore xbuild DistribTest.sln diff --git a/test/distrib/csharp/run_distrib_test_dotnetcli.sh b/test/distrib/csharp/run_distrib_test_dotnetcli.sh index 9e31945dfb..86c2d5231e 100755 --- a/test/distrib/csharp/run_distrib_test_dotnetcli.sh +++ b/test/distrib/csharp/run_distrib_test_dotnetcli.sh @@ -25,19 +25,22 @@ cd DistribTest # TODO(jtattermusch): make sure we don't pollute the global nuget cache with # the nugets being tested. -dotnet restore +dotnet restore DistribTestDotNet.csproj -dotnet build -dotnet publish +dotnet build DistribTestDotNet.csproj +dotnet publish -f netcoreapp1.0 DistribTestDotNet.csproj +dotnet publish -f net45 DistribTestDotNet.csproj + +ls -R bin # .NET 4.5 target after dotnet build -mono bin/Debug/net45/*-x64/DistribTest.exe +mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET 4.5 target after dotnet publish -mono bin/Debug/net45/*-x64/publish/DistribTest.exe +mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET Core target after dotnet build -dotnet exec bin/Debug/netcoreapp1.0/DistribTest.dll +dotnet exec bin/Debug/netcoreapp1.0/DistribTestDotNet.dll # .NET Core target after dotnet publish -dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTest.dll +dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTestDotNet.dll diff --git a/test/distrib/csharp/update_version.sh b/test/distrib/csharp/update_version.sh index 734ec21ba2..9759cc5648 100755 --- a/test/distrib/csharp/update_version.sh +++ b/test/distrib/csharp/update_version.sh @@ -28,4 +28,4 @@ then fi # Replaces version placeholder with value provided as first argument. -sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/project.json +sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj |