Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 1 | @rem Copyright 2016, Google Inc. |
| 2 | @rem All rights reserved. |
| 3 | @rem |
| 4 | @rem Redistribution and use in source and binary forms, with or without |
| 5 | @rem modification, are permitted provided that the following conditions are |
| 6 | @rem met: |
| 7 | @rem |
| 8 | @rem * Redistributions of source code must retain the above copyright |
| 9 | @rem notice, this list of conditions and the following disclaimer. |
| 10 | @rem * Redistributions in binary form must reproduce the above |
| 11 | @rem copyright notice, this list of conditions and the following disclaimer |
| 12 | @rem in the documentation and/or other materials provided with the |
| 13 | @rem distribution. |
| 14 | @rem * Neither the name of Google Inc. nor the names of its |
| 15 | @rem contributors may be used to endorse or promote products derived from |
| 16 | @rem this software without specific prior written permission. |
| 17 | @rem |
| 18 | @rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | @rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | @rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | @rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | @rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | @rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | @rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | @rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | @rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | @rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | |
| 30 | @rem Current package versions |
David Garcia Quintas | 9e1acc0 | 2017-04-13 16:30:15 -0700 | [diff] [blame] | 31 | set VERSION=1.4.0-dev |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 32 | |
| 33 | @rem Adjust the location of nuget.exe |
| 34 | set NUGET=C:\nuget\nuget.exe |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 35 | set DOTNET=dotnet |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 36 | |
| 37 | set -ex |
| 38 | |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame^] | 39 | mkdir ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 40 | |
| 41 | @rem Collect the artifacts built by the previous build step if running on Jenkins |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame^] | 42 | mkdir nativelibs |
| 43 | powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 44 | |
| 45 | @rem Collect protoc artifacts built by the previous build step |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame^] | 46 | mkdir protoc_plugins |
| 47 | powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 48 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 49 | %DOTNET% restore Grpc.sln || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 50 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 51 | @rem To be able to build, we also need to put grpc_csharp_ext to its normal location |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame^] | 52 | xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release\ |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 53 | |
| 54 | %DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error |
| 55 | %DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error |
| 56 | %DOTNET% pack --configuration Release Grpc.Auth --output ..\..\..\artifacts || goto :error |
| 57 | %DOTNET% pack --configuration Release Grpc.HealthCheck --output ..\..\..\artifacts || goto :error |
| 58 | %DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 59 | |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame] | 60 | %NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error |
| 61 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 62 | |
| 63 | @rem copy resulting nuget packages to artifacts directory |
| 64 | xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error |
| 65 | |
| 66 | @rem create a zipfile with the artifacts as well |
| 67 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');" |
| 68 | xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error |
| 69 | |
| 70 | goto :EOF |
| 71 | |
| 72 | :error |
| 73 | echo Failed! |
| 74 | exit /b %errorlevel% |