build_packages.bat 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. @rem Builds gRPC NuGet packages
  2. @rem Current package versions
  3. set VERSION=0.14.0-dev
  4. set PROTOBUF_VERSION=3.0.0-beta2
  5. @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
  6. set VERSION_WITH_BETA=%VERSION%-beta
  7. @rem Adjust the location of nuget.exe
  8. set NUGET=C:\nuget\nuget.exe
  9. @rem Collect the artifacts built by the previous build step if running on Jenkins
  10. @rem TODO(jtattermusch): is there a better way to do this?
  11. xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* grpc.native.csharp\windows_x86\
  12. xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* grpc.native.csharp\windows_x64\
  13. xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* grpc.native.csharp\linux_x86\
  14. xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* grpc.native.csharp\linux_x64\
  15. xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x86\
  16. xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x64\
  17. @rem Fetch all dependencies
  18. %NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
  19. %NUGET% restore Grpc.sln || goto :error
  20. setlocal
  21. @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
  22. @rem We won't use the native libraries from this step, but without this Grpc.sln will fail.
  23. msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
  24. msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error
  25. endlocal
  26. @rem TODO(jtattermusch): re-enable protoc plugin building
  27. @rem @call ..\..\vsprojects\build_plugins.bat || goto :error
  28. %NUGET% pack grpc.native.csharp\grpc.native.csharp.nuspec -Version %VERSION% || goto :error
  29. %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
  30. %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error
  31. %NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
  32. %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error
  33. @rem TODO(jtattermusch): re-enable building Grpc.Tools package
  34. @rem %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
  35. @rem copy resulting nuget packages to artifacts directory
  36. xcopy /Y /I *.nupkg ..\..\artifacts\
  37. @rem create a zipfile with the artifacts as well
  38. powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
  39. xcopy /Y /I csharp_nugets.zip ..\..\artifacts\
  40. goto :EOF
  41. :error
  42. echo Failed!
  43. exit /b %errorlevel%