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