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 |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame^] | 31 | set VERSION=1.1.0-dev |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 32 | set PROTOBUF_VERSION=3.0.0 |
| 33 | |
| 34 | @rem Adjust the location of nuget.exe |
| 35 | set NUGET=C:\nuget\nuget.exe |
| 36 | set DOTNET=C:\dotnet\dotnet.exe |
| 37 | |
| 38 | set -ex |
| 39 | |
| 40 | mkdir -p ..\..\artifacts\ |
| 41 | |
| 42 | @rem Collect the artifacts built by the previous build step if running on Jenkins |
| 43 | @rem TODO(jtattermusch): is there a better way to do this? |
| 44 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* nativelibs\windows_x86\ |
| 45 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* nativelibs\windows_x64\ |
| 46 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* nativelibs\linux_x86\ |
| 47 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* nativelibs\linux_x64\ |
| 48 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x86\ |
| 49 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x64\ |
| 50 | |
| 51 | @rem Collect protoc artifacts built by the previous build step |
| 52 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\ |
| 53 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\ |
| 54 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\ |
| 55 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\ |
| 56 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\ |
| 57 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\ |
| 58 | |
| 59 | %DOTNET% restore . || goto :error |
| 60 | |
| 61 | %DOTNET% pack --configuration Release Grpc.Core\project.json --output ..\..\artifacts || goto :error |
| 62 | %DOTNET% pack --configuration Release Grpc.Auth\project.json --output ..\..\artifacts || goto :error |
| 63 | %DOTNET% pack --configuration Release Grpc.HealthCheck\project.json --output ..\..\artifacts || goto :error |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame^] | 64 | %DOTNET% pack --configuration Release Grpc.Reflection\project.json --output ..\..\artifacts || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 65 | |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame^] | 66 | %NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error |
| 67 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 68 | |
| 69 | @rem copy resulting nuget packages to artifacts directory |
| 70 | xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error |
| 71 | |
| 72 | @rem create a zipfile with the artifacts as well |
| 73 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');" |
| 74 | xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error |
| 75 | |
| 76 | goto :EOF |
| 77 | |
| 78 | :error |
| 79 | echo Failed! |
| 80 | exit /b %errorlevel% |