Jan Tattermusch | f551edf | 2016-05-13 10:49:17 -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 | |
Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 30 | @rem Builds gRPC NuGet packages |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 31 | |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 32 | @rem Current package versions |
Nicolas "Pixel" Noble | 49bfb92 | 2016-07-12 09:31:41 +0200 | [diff] [blame] | 33 | set VERSION=1.1.0-dev |
Nicolas "Pixel" Noble | f2c074a | 2016-08-12 03:23:10 +0200 | [diff] [blame] | 34 | set PROTOBUF_VERSION=3.0.0 |
Jan Tattermusch | c84c2e3 | 2015-09-02 13:58:25 -0700 | [diff] [blame] | 35 | |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 36 | @rem Adjust the location of nuget.exe |
| 37 | set NUGET=C:\nuget\nuget.exe |
| 38 | |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 39 | @rem Collect the artifacts built by the previous build step if running on Jenkins |
| 40 | @rem TODO(jtattermusch): is there a better way to do this? |
Jan Tattermusch | ec4359d | 2016-04-11 20:55:44 -0700 | [diff] [blame] | 41 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* nativelibs\windows_x86\ |
| 42 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* nativelibs\windows_x64\ |
| 43 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* nativelibs\linux_x86\ |
| 44 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* nativelibs\linux_x64\ |
| 45 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x86\ |
| 46 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x64\ |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 47 | |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 48 | @rem Collect protoc artifacts built by the previous build step |
| 49 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\ |
| 50 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\ |
| 51 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\ |
| 52 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\ |
| 53 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\ |
| 54 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\ |
| 55 | |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 56 | @rem Fetch all dependencies |
| 57 | %NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 58 | |
Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 59 | setlocal |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 60 | |
| 61 | @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 |
| 62 | |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 63 | @rem We won't use the native libraries from this step, but without this Grpc.sln will fail. |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 64 | msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error |
| 65 | |
| 66 | msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error |
| 67 | |
Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 68 | endlocal |
| 69 | |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 70 | %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error |
Jan Tattermusch | f923a2d | 2016-01-22 14:33:53 -0800 | [diff] [blame] | 71 | %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error |
Nicolas "Pixel" Noble | f2c074a | 2016-08-12 03:23:10 +0200 | [diff] [blame] | 72 | %NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 73 | %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 74 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 75 | |
| 76 | @rem copy resulting nuget packages to artifacts directory |
| 77 | xcopy /Y /I *.nupkg ..\..\artifacts\ |
| 78 | |
Jan Tattermusch | 8e90ca1 | 2016-01-29 16:30:58 -0800 | [diff] [blame] | 79 | @rem create a zipfile with the artifacts as well |
| 80 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');" |
| 81 | xcopy /Y /I csharp_nugets.zip ..\..\artifacts\ |
| 82 | |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 83 | goto :EOF |
| 84 | |
| 85 | :error |
| 86 | echo Failed! |
Jan Tattermusch | 031c7ee | 2015-05-14 18:32:17 -0700 | [diff] [blame] | 87 | exit /b %errorlevel% |