Merge pull request #8076 from jtattermusch/csharp_use_dotnetcli_nugets

Start using nuget packages built by dotnet CLI
pull/8109/head
Nicolas Noble 8 years ago committed by GitHub
commit 8e6d871558
  1. 25
      src/csharp/Grpc.Tools.nuspec
  2. 8
      src/csharp/build_packages.bat
  3. 3
      src/csharp/build_packages_dotnetcli.sh
  4. 8
      templates/src/csharp/build_packages.bat.template
  5. 3
      templates/src/csharp/build_packages_dotnetcli.sh.template
  6. 14
      test/distrib/csharp/run_distrib_test.bat
  7. 2
      test/distrib/csharp/run_distrib_test.sh
  8. 2
      test/distrib/csharp/run_distrib_test_dotnetcli.sh
  9. 6
      tools/run_tests/build_artifact_protoc.bat
  10. 3
      tools/run_tests/pre_build_csharp.bat
  11. 3
      tools/run_tests/pre_build_csharp.sh

@ -16,17 +16,18 @@
<tags>gRPC RPC Protocol HTTP/2</tags>
</metadata>
<files>
<file src="protoc_plugins\windows_x86\protoc.exe" target="tools\windows_x86\protoc.exe" />
<file src="protoc_plugins\windows_x86\grpc_csharp_plugin.exe" target="tools\windows_x86\grpc_csharp_plugin.exe" />
<file src="protoc_plugins\windows_x64\protoc.exe" target="tools\windows_x64\protoc.exe" />
<file src="protoc_plugins\windows_x64\grpc_csharp_plugin.exe" target="tools\windows_x64\grpc_csharp_plugin.exe" />
<file src="protoc_plugins\linux_x86\protoc" target="tools\linux_x86\protoc" />
<file src="protoc_plugins\linux_x86\grpc_csharp_plugin" target="tools\linux_x86\grpc_csharp_plugin" />
<file src="protoc_plugins\linux_x64\protoc" target="tools\linux_x64\protoc" />
<file src="protoc_plugins\linux_x64\grpc_csharp_plugin" target="tools\linux_x64\grpc_csharp_plugin" />
<file src="protoc_plugins\macosx_x86\protoc" target="tools\macosx_x86\protoc" />
<file src="protoc_plugins\macosx_x86\grpc_csharp_plugin" target="tools\macosx_x86\grpc_csharp_plugin" />
<file src="protoc_plugins\macosx_x64\protoc" target="tools\macosx_x64\protoc" />
<file src="protoc_plugins\macosx_x64\grpc_csharp_plugin" target="tools\macosx_x64\grpc_csharp_plugin" />
<!-- forward slashes in src path enable building on Linux -->
<file src="protoc_plugins/windows_x86/protoc.exe" target="tools\windows_x86\protoc.exe" />
<file src="protoc_plugins/windows_x86/grpc_csharp_plugin.exe" target="tools\windows_x86\grpc_csharp_plugin.exe" />
<file src="protoc_plugins/windows_x64/protoc.exe" target="tools\windows_x64\protoc.exe" />
<file src="protoc_plugins/windows_x64/grpc_csharp_plugin.exe" target="tools\windows_x64\grpc_csharp_plugin.exe" />
<file src="protoc_plugins/linux_x86/protoc" target="tools\linux_x86\protoc" />
<file src="protoc_plugins/linux_x86/grpc_csharp_plugin" target="tools\linux_x86\grpc_csharp_plugin" />
<file src="protoc_plugins/linux_x64/protoc" target="tools\linux_x64\protoc" />
<file src="protoc_plugins/linux_x64/grpc_csharp_plugin" target="tools\linux_x64\grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x86/protoc" target="tools\macosx_x86\protoc" />
<file src="protoc_plugins/macosx_x86/grpc_csharp_plugin" target="tools\macosx_x86\grpc_csharp_plugin" />
<file src="protoc_plugins/macosx_x64/protoc" target="tools\macosx_x64\protoc" />
<file src="protoc_plugins/macosx_x64/grpc_csharp_plugin" target="tools\macosx_x64\grpc_csharp_plugin" />
</files>
</package>

@ -29,6 +29,10 @@
@rem Builds gRPC NuGet packages
@rem This way of building nuget packages is now obsolete. C# nuget packages
@rem with CoreCLR support are now being built using the dotnet cli
@rem in build_packages_dotnetcli.sh
@rem Current package versions
set VERSION=1.1.0-dev
set PROTOBUF_VERSION=3.0.0
@ -77,8 +81,8 @@ endlocal
xcopy /Y /I *.nupkg ..\..\artifacts\
@rem create a zipfile with the artifacts as well
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
xcopy /Y /I csharp_nugets.zip ..\..\artifacts\
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_obsolete.zip');"
xcopy /Y /I csharp_nugets_obsolete.zip ..\..\artifacts\
goto :EOF

@ -34,9 +34,6 @@ 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

@ -31,6 +31,10 @@
@rem Builds gRPC NuGet packages
@rem This way of building nuget packages is now obsolete. C# nuget packages
@rem with CoreCLR support are now being built using the dotnet cli
@rem in build_packages_dotnetcli.sh
@rem Current package versions
set VERSION=${settings.csharp_version}
set PROTOBUF_VERSION=3.0.0
@ -79,8 +83,8 @@
xcopy /Y /I *.nupkg ..\..\artifacts${"\\"}
@rem create a zipfile with the artifacts as well
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
xcopy /Y /I csharp_nugets.zip ..\..\artifacts${"\\"}
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_obsolete.zip');"
xcopy /Y /I csharp_nugets_obsolete.zip ..\..\artifacts${"\\"}
goto :EOF

@ -36,9 +36,6 @@
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

@ -31,12 +31,22 @@
cd /d %~dp0
@rem extract input artifacts
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../input_artifacts/csharp_nugets.zip', 'TestNugetFeed');"
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../input_artifacts/csharp_nugets_dotnetcli.zip', 'TestNugetFeed');"
update_version.sh auto
set NUGET=C:\nuget\nuget.exe
%NUGET% restore || goto :error
@rem TODO(jtattermusch): Get rid of this hack. See #8034
@rem We can't do just "nuget restore" because restoring a .sln solution doesn't work
@rem with nuget 3.X. On the other hand, we need nuget 2.12+ to be able to restore
@rem some of the packages (e.g. System.Interactive.Async), but nuget 2.12
@rem hasn't been officially released.
@rem Please note that "Restore nuget packages" in VS2013 and VS2015 GUI works as usual.
cd DistribTest || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..
@call build_vs2015.bat DistribTest.sln %MSBUILD_EXTRA_ARGS% || goto :error

@ -32,7 +32,7 @@ set -ex
cd $(dirname $0)
unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets.zip" -d TestNugetFeed
unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_dotnetcli.zip" -d TestNugetFeed
./update_version.sh auto

@ -32,7 +32,7 @@ set -ex
cd $(dirname $0)
unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets.zip" -d TestNugetFeed
unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_dotnetcli.zip" -d TestNugetFeed
./update_version.sh auto

@ -32,12 +32,8 @@ mkdir artifacts
setlocal
cd third_party/protobuf
powershell -Command "Invoke-WebRequest https://googlemock.googlecode.com/files/gmock-1.7.0.zip -OutFile gmock.zip"
powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('gmock.zip', '.');"
rename gmock-1.7.0 gmock
cd cmake
cmake -G "%generator%" || goto :error
cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF || goto :error
endlocal
call vsprojects/build_plugins.bat || goto :error

@ -38,9 +38,10 @@ cd /d %~dp0\..\..
set NUGET=C:\nuget\nuget.exe
if exist %NUGET% (
@rem TODO(jtattermusch): Get rid of this hack. See #8034
@rem Restore Grpc packages by packages since Nuget client 3.4.4 doesnt support restore
@rem by solution
@rem Moving into each directory to let the restores work with both nuget 3.4 and 2.8
@rem Moving into each directory to let the restores work based on per-project packages.config files
%NUGET% restore vsprojects/grpc_csharp_ext.sln || goto :error
cd src/csharp

@ -37,9 +37,10 @@ root=`pwd`
if [ -x "$(command -v nuget)" ]
then
# TODO(jtattermusch): Get rid of this hack. See #8034
# Restoring Nuget packages by packages rather than by solution because of
# inability to restore by solution with Nuget client 3.4.4
# Moving into each directory to let the restores work with nuget 3.4 and 2.8
# Moving into each directory to let the restores work based on per-project packages.config files
cd Grpc.Auth
nuget restore -PackagesDirectory ../packages
cd ..

Loading…
Cancel
Save