Merge pull request #8039 from jtattermusch/dotnetcli_distribtest_prototype

Dotnet CLI distrib tests and associated cleanup.
pull/7833/head^2
Jan Tattermusch 8 years ago committed by GitHub
commit eeb21d1fae
  1. 11
      src/csharp/Grpc.Core.Tests/project.json
  2. 18
      src/csharp/Grpc.Core/Internal/NativeExtension.cs
  3. 11
      src/csharp/Grpc.Examples.MathClient/project.json
  4. 11
      src/csharp/Grpc.Examples.MathServer/project.json
  5. 11
      src/csharp/Grpc.Examples.Tests/project.json
  6. 11
      src/csharp/Grpc.Examples/project.json
  7. 11
      src/csharp/Grpc.HealthCheck.Tests/project.json
  8. 11
      src/csharp/Grpc.IntegrationTesting.Client/project.json
  9. 11
      src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
  10. 11
      src/csharp/Grpc.IntegrationTesting.Server/project.json
  11. 11
      src/csharp/Grpc.IntegrationTesting.StressClient/project.json
  12. 11
      src/csharp/Grpc.IntegrationTesting/project.json
  13. 24
      src/csharp/build_packages_dotnetcli.sh
  14. 6
      templates/src/csharp/Grpc.Core.Tests/project.json.template
  15. 6
      templates/src/csharp/Grpc.Examples.MathClient/project.json.template
  16. 6
      templates/src/csharp/Grpc.Examples.MathServer/project.json.template
  17. 6
      templates/src/csharp/Grpc.Examples.Tests/project.json.template
  18. 6
      templates/src/csharp/Grpc.Examples/project.json.template
  19. 6
      templates/src/csharp/Grpc.HealthCheck.Tests/project.json.template
  20. 6
      templates/src/csharp/Grpc.IntegrationTesting.Client/project.json.template
  21. 6
      templates/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json.template
  22. 6
      templates/src/csharp/Grpc.IntegrationTesting.Server/project.json.template
  23. 6
      templates/src/csharp/Grpc.IntegrationTesting.StressClient/project.json.template
  24. 6
      templates/src/csharp/Grpc.IntegrationTesting/project.json.template
  25. 5
      templates/src/csharp/build_options.include
  26. 75
      templates/src/csharp/build_packages_dotnetcli.sh.template
  27. 1
      test/distrib/csharp/DistribTest/.gitignore
  28. 11
      test/distrib/csharp/DistribTest/DistribTest.project.json
  29. 22
      test/distrib/csharp/DistribTest/project.json
  30. 58
      test/distrib/csharp/run_distrib_test_dotnetcli.sh
  31. 6
      test/distrib/csharp/update_version.sh
  32. 4
      tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
  33. 3
      tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
  34. 3
      tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
  35. 20
      tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
  36. 3
      tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
  37. 3
      tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
  38. 5
      tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
  39. 5
      tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
  40. 2
      tools/run_tests/build_csharp_coreclr.bat
  41. 16
      tools/run_tests/distribtest_targets.py
  42. 14
      tools/run_tests/package_targets.py
  43. 12
      tools/run_tests/run_tests.py

@ -42,11 +42,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Core": { "Grpc.Core": {
@ -66,8 +61,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
}, },

@ -100,19 +100,19 @@ namespace Grpc.Core.Internal
// With old-style VS projects, the native libraries get copied using a .targets rule to the build output folder // With old-style VS projects, the native libraries get copied using a .targets rule to the build output folder
// alongside the compiled assembly. // alongside the compiled assembly.
// With dotnet cli projects, the native libraries (just the required ones) are similarly copied to the built output folder, // With dotnet cli projects targeting net45 framework, the native libraries (just the required ones)
// through the magic of Microsoft.NETCore.Platforms. // are similarly copied to the built output folder, through the magic of Microsoft.NETCore.Platforms.
var classicPath = Path.Combine(assemblyDirectory, GetNativeLibraryFilename()); var classicPath = Path.Combine(assemblyDirectory, GetNativeLibraryFilename());
// DNX-style project.json projects will use Grpc.Core assembly directly in the location where it got restored // With dotnet cli project targeting netcoreapp1.0, projects will use Grpc.Core assembly directly in the location where it got restored
// by nuget. We locate the native libraries based on known structure of Grpc.Core nuget package. // by nuget. We locate the native libraries based on known structure of Grpc.Core nuget package.
// When "dotnet publish" is used, the runtimes directory is copied next to the published assemblies.
string runtimesDirectory = string.Format("runtimes/{0}/native", GetPlatformString());
var netCorePublishedAppStylePath = Path.Combine(assemblyDirectory, runtimesDirectory, GetNativeLibraryFilename());
var netCoreAppStylePath = Path.Combine(assemblyDirectory, "../..", runtimesDirectory, GetNativeLibraryFilename());
// TODO: Support .NET Core applications, which act slightly differently. We may be okay if "dotnet publish" // Look for all native library in all possible locations in given order.
// is used, but "dotnet run" leaves the native libraries in-package, while copying assemblies. string[] paths = new[] { classicPath, netCorePublishedAppStylePath, netCoreAppStylePath};
string platform = GetPlatformString();
string relativeDirectory = string.Format("../../runtimes/{0}/native", platform);
var dnxStylePath = Path.Combine(assemblyDirectory, relativeDirectory, GetNativeLibraryFilename());
string[] paths = new[] { classicPath, dnxStylePath };
return new UnmanagedLibrary(paths); return new UnmanagedLibrary(paths);
} }

@ -42,11 +42,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Examples": { "Grpc.Examples": {
@ -57,8 +52,10 @@
"net45": { }, "net45": { },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -42,11 +42,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Examples": { "Grpc.Examples": {
@ -57,8 +52,10 @@
"net45": { }, "net45": { },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -42,11 +42,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Examples": { "Grpc.Examples": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -1,11 +1,6 @@
{ {
"buildOptions": { "buildOptions": {
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Core": { "Grpc.Core": {
@ -22,8 +17,10 @@
}, },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -42,11 +42,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.HealthCheck": { "Grpc.HealthCheck": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -44,11 +44,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.IntegrationTesting": { "Grpc.IntegrationTesting": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -44,11 +44,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.IntegrationTesting": { "Grpc.IntegrationTesting": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -44,11 +44,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.IntegrationTesting": { "Grpc.IntegrationTesting": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -44,11 +44,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.IntegrationTesting": { "Grpc.IntegrationTesting": {
@ -62,8 +57,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -44,11 +44,6 @@
} }
} }
}, },
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": { "dependencies": {
"Grpc.Auth": { "Grpc.Auth": {
@ -75,8 +70,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0", "type": "platform",
"version": "1.0.0"
},
"System.Linq.Expressions": "4.1.0" "System.Linq.Expressions": "4.1.0"
} }
} }

@ -30,11 +30,9 @@
set -ex set -ex
cd $(dirname $0)/../.. cd $(dirname $0)
mkdir -p artifacts/ mkdir -p ../../artifacts/
cd src/csharp
# IMPORTANT: NuGet packages generated by dotnet CLI are considered experimental. # IMPORTANT: NuGet packages generated by dotnet CLI are considered experimental.
# The official nugets are generated by src/csharp/build_packages.bat # The official nugets are generated by src/csharp/build_packages.bat
@ -43,6 +41,11 @@ mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
nativelibs/linux_x86 nativelibs/linux_x64 \ nativelibs/linux_x86 nativelibs/linux_x64 \
nativelibs/macosx_x86 nativelibs/macosx_x64 nativelibs/macosx_x86 nativelibs/macosx_x64
mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \
protoc_plugins/linux_x86 protoc_plugins/linux_x64 \
protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
# Collect the artifacts built by the previous build step if running on Jenkins
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
@ -50,10 +53,21 @@ cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
# Collect protoc artifacts built by the previous build step
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
dotnet restore . dotnet restore .
dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts
tar -czf ../../artifacts/csharp_nugets_experimental.tar.gz ../../artifacts/*.nupkg nuget pack Grpc.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
nuget pack Grpc.Tools.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)

@ -20,8 +20,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
}, },

@ -11,8 +11,10 @@
"net45": { }, "net45": { },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -11,8 +11,10 @@
"net45": { }, "net45": { },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -16,8 +16,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -17,8 +17,10 @@
}, },
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -16,8 +16,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -14,8 +14,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -14,8 +14,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -14,8 +14,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -14,8 +14,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0" "type": "platform",
"version": "1.0.0"
}
} }
} }
} }

@ -27,8 +27,10 @@
"portable-net45" "portable-net45"
], ],
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": "1.0.0", "Microsoft.NETCore.App": {
"NETStandard.Library": "1.6.0", "type": "platform",
"version": "1.0.0"
},
"System.Linq.Expressions": "4.1.0" "System.Linq.Expressions": "4.1.0"
} }
} }

@ -52,8 +52,3 @@
} }
}, },
%endif %endif
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},

@ -0,0 +1,75 @@
%YAML 1.2
--- |
#!/bin/bash
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
cd $(dirname $0)
mkdir -p ../../artifacts/
# IMPORTANT: NuGet packages generated by dotnet CLI are considered experimental.
# The official nugets are generated by src/csharp/build_packages.bat
mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 ${"\\"}
nativelibs/linux_x86 nativelibs/linux_x64 ${"\\"}
nativelibs/macosx_x86 nativelibs/macosx_x64
mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 ${"\\"}
protoc_plugins/linux_x86 protoc_plugins/linux_x64 ${"\\"}
protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
# Collect the artifacts built by the previous build step if running on Jenkins
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
# Collect protoc artifacts built by the previous build step
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
dotnet restore .
dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts
dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts
nuget pack Grpc.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts
nuget pack Grpc.Tools.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts
(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)

@ -1,2 +1,3 @@
bin bin
obj obj
*.lock.json

@ -0,0 +1,11 @@
// 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": { }
}
}

@ -0,0 +1,22 @@
{
"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"
}
}
}
}
}

@ -0,0 +1,58 @@
#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
cd $(dirname $0)
unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets.zip" -d TestNugetFeed
./update_version.sh auto
cd DistribTest
# TODO(jtattermusch): make sure we don't pollute the global nuget cache with
# the nugets being tested.
dotnet restore
dotnet build
dotnet publish
# .NET 4.5 target after dotnet build
mono bin/Debug/net45/*-x64/DistribTest.exe
# .NET 4.5 target after dotnet publish
mono bin/Debug/net45/*-x64/publish/DistribTest.exe
# .NET Core target after dotnet build
dotnet exec bin/Debug/netcoreapp1.0/DistribTest.dll
# .NET Core target after dotnet publish
dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTest.dll

@ -35,10 +35,10 @@ cd $(dirname $0)
CSHARP_VERSION="$1" CSHARP_VERSION="$1"
if [ "$CSHARP_VERSION" == "auto" ] if [ "$CSHARP_VERSION" == "auto" ]
then then
# autodetect C# version # autodetect C# version from the name of Grpc.Core.0.0.0-x.nupkg file
CSHARP_VERSION=$(ls TestNugetFeed | grep '^Grpc\.[0-9].*\.nupkg$' | sed s/^Grpc\.// | sed s/\.nupkg$//) CSHARP_VERSION=$(ls TestNugetFeed | grep -m 1 '^Grpc\.Core\.[0-9].*\.nupkg$' | sed s/^Grpc\.Core\.// | sed s/\.nupkg$// | sed s/\.symbols$//)
echo "Autodetected nuget ${CSHARP_VERSION}" echo "Autodetected nuget ${CSHARP_VERSION}"
fi fi
# Replaces version placeholder with value provided as first argument. # Replaces version placeholder with value provided as first argument.
sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/project.json

@ -34,6 +34,6 @@ RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
RUN yum install -y mono RUN yum install -y mono
RUN yum install -y unzip RUN yum install -y unzip
RUN yum install -y nuget
RUN nuget update -self # --nogpgcheck because nuget-2.12 package is not signed.
RUN yum install -y nuget --nogpgcheck

@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -37,6 +37,24 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip
# Install dotnet CLI
RUN apt-get install -y apt-transport-https
RUN sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
RUN apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
RUN apt-get update && apt-get install -y dotnet-dev-1.0.0-preview2-003121
# Trigger the population of the local package cache for dotnet CLI
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rm -rf warmup
# TODO(jtattermusch): without libc-dev, netcoreapp1.0 targets fail with
# System.DllNotFoundException: Unable to load DLL 'libdl.so'
RUN apt-get install -y libc-dev

@ -37,6 +37,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -37,6 +37,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -34,6 +34,9 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \ ca-certificates-mono \
nuget nuget
RUN nuget update -self # make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -27,6 +27,9 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM mono:4.2.2.30 FROM mono:4.4.2.11
# make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip RUN apt-get update && apt-get install -y unzip

@ -33,7 +33,7 @@ cd /d %~dp0\..\..\src\csharp
dotnet restore . || goto :error dotnet restore . || goto :error
dotnet build -f netstandard1.5 --configuration %MSBUILD_CONFIG% "**/project.json" || goto :error dotnet build --configuration %MSBUILD_CONFIG% "**/project.json" || goto :error
endlocal endlocal

@ -72,15 +72,22 @@ def create_jobspec(name, cmdline, environ=None, shell=False,
class CSharpDistribTest(object): class CSharpDistribTest(object):
"""Tests C# NuGet package""" """Tests C# NuGet package"""
def __init__(self, platform, arch, docker_suffix=None): def __init__(self, platform, arch, docker_suffix=None, use_dotnet_cli=False):
self.name = 'csharp_nuget_%s_%s' % (platform, arch) self.name = 'csharp_nuget_%s_%s' % (platform, arch)
self.platform = platform self.platform = platform
self.arch = arch self.arch = arch
self.docker_suffix = docker_suffix self.docker_suffix = docker_suffix
self.labels = ['distribtest', 'csharp', platform, arch] self.labels = ['distribtest', 'csharp', platform, arch]
self.script_suffix = ''
if docker_suffix: if docker_suffix:
self.name += '_%s' % docker_suffix self.name += '_%s' % docker_suffix
self.labels.append(docker_suffix) self.labels.append(docker_suffix)
if use_dotnet_cli:
self.name += '_dotnetcli'
self.script_suffix = '_dotnetcli'
self.labels.append('dotnetcli')
else:
self.labels.append('olddotnet')
def pre_build_jobspecs(self): def pre_build_jobspecs(self):
return [] return []
@ -91,10 +98,10 @@ class CSharpDistribTest(object):
'tools/dockerfile/distribtest/csharp_%s_%s' % ( 'tools/dockerfile/distribtest/csharp_%s_%s' % (
self.docker_suffix, self.docker_suffix,
self.arch), self.arch),
'test/distrib/csharp/run_distrib_test.sh') 'test/distrib/csharp/run_distrib_test%s.sh' % self.script_suffix)
elif self.platform == 'macos': elif self.platform == 'macos':
return create_jobspec(self.name, return create_jobspec(self.name,
['test/distrib/csharp/run_distrib_test.sh'], ['test/distrib/csharp/run_distrib_test%s.sh' % self.script_suffix],
environ={'EXTERNAL_GIT_ROOT': '../../..'}) environ={'EXTERNAL_GIT_ROOT': '../../..'})
elif self.platform == 'windows': elif self.platform == 'windows':
if self.arch == 'x64': if self.arch == 'x64':
@ -103,7 +110,7 @@ class CSharpDistribTest(object):
else: else:
environ={'DISTRIBTEST_OUTPATH': 'DistribTest\\bin\\\Debug'} environ={'DISTRIBTEST_OUTPATH': 'DistribTest\\bin\\\Debug'}
return create_jobspec(self.name, return create_jobspec(self.name,
['test\\distrib\\csharp\\run_distrib_test.bat'], ['test\\distrib\\csharp\\run_distrib_test%s.bat' % self.script_suffix],
environ=environ) environ=environ)
else: else:
raise Exception("Not supported yet.") raise Exception("Not supported yet.")
@ -276,6 +283,7 @@ def targets():
CSharpDistribTest('linux', 'x64', 'ubuntu1504'), CSharpDistribTest('linux', 'x64', 'ubuntu1504'),
CSharpDistribTest('linux', 'x64', 'ubuntu1510'), CSharpDistribTest('linux', 'x64', 'ubuntu1510'),
CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'),
CSharpDistribTest('linux', 'x64', 'ubuntu1404', use_dotnet_cli=True),
CSharpDistribTest('macos', 'x86'), CSharpDistribTest('macos', 'x86'),
CSharpDistribTest('windows', 'x86'), CSharpDistribTest('windows', 'x86'),
CSharpDistribTest('windows', 'x64'), CSharpDistribTest('windows', 'x64'),

@ -71,11 +71,11 @@ def create_jobspec(name, cmdline, environ=None, cwd=None, shell=False,
class CSharpPackage: class CSharpPackage:
"""Builds C# nuget packages.""" """Builds C# nuget packages."""
def __init__(self, use_coreclr=False): def __init__(self, use_dotnet_cli=False):
self.use_coreclr = use_coreclr self.use_dotnet_cli = use_dotnet_cli
self.name = 'csharp_package_coreclr' if use_coreclr else 'csharp_package' self.name = 'csharp_package_dotnetcli' if use_dotnet_cli else 'csharp_package'
self.labels = ['package', 'csharp'] self.labels = ['package', 'csharp']
if use_coreclr: if use_dotnet_cli:
self.labels += ['linux'] self.labels += ['linux']
else: else:
self.labels += ['windows'] self.labels += ['windows']
@ -91,11 +91,11 @@ class CSharpPackage:
return [] return []
def build_jobspec(self): def build_jobspec(self):
if self.use_coreclr: if self.use_dotnet_cli:
return create_docker_jobspec( return create_docker_jobspec(
self.name, self.name,
'tools/dockerfile/test/csharp_coreclr_x64', 'tools/dockerfile/test/csharp_coreclr_x64',
'tools/run_tests/build_package_csharp_coreclr.sh') 'src/csharp/build_packages_dotnetcli.sh')
else: else:
return create_jobspec(self.name, return create_jobspec(self.name,
['build_packages.bat'], ['build_packages.bat'],
@ -177,7 +177,7 @@ class PHPPackage:
def targets(): def targets():
"""Gets list of supported targets""" """Gets list of supported targets"""
return [CSharpPackage(), return [CSharpPackage(),
CSharpPackage(use_coreclr=True), CSharpPackage(use_dotnet_cli=True),
NodePackage(), NodePackage(),
RubyPackage(), RubyPackage(),
PythonPackage(), PythonPackage(),

@ -654,15 +654,9 @@ class CSharpLanguage(object):
assembly_extension = '.exe' assembly_extension = '.exe'
if self.args.compiler == 'coreclr': if self.args.compiler == 'coreclr':
if self.platform == 'linux': assembly_subdir += '/netcoreapp1.0'
assembly_subdir += '/netstandard1.5/debian.8-x64' runtime_cmd = ['dotnet', 'exec']
assembly_extension = '' assembly_extension = '.dll'
elif self.platform == 'mac':
assembly_subdir += '/netstandard1.5/osx.10.11-x64'
assembly_extension = ''
else:
assembly_subdir += '/netstandard1.5/win7-x64'
runtime_cmd = []
else: else:
nunit_args += ['--noresult', '--workers=1'] nunit_args += ['--noresult', '--workers=1']
if self.platform == 'windows': if self.platform == 'windows':

Loading…
Cancel
Save