blob: b92189c840e94ee195de5842c1ea553e4a298800 [file] [log] [blame]
Jan Tattermuschf551edf2016-05-13 10:49:17 -07001@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 Tattermusch73d7fab2015-05-15 16:16:55 -070030@rem Builds gRPC NuGet packages
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070031
Jan Tattermusch48f7ed42015-07-13 21:14:17 -070032@rem Current package versions
Nicolas "Pixel" Noble49bfb922016-07-12 09:31:41 +020033set VERSION=1.1.0-dev
Nicolas "Pixel" Noblef2c074a2016-08-12 03:23:10 +020034set PROTOBUF_VERSION=3.0.0
Jan Tattermuschc84c2e32015-09-02 13:58:25 -070035
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070036@rem Adjust the location of nuget.exe
37set NUGET=C:\nuget\nuget.exe
38
Jan Tattermuschf087ec02016-01-21 11:17:44 -080039@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 Tattermuschec4359d2016-04-11 20:55:44 -070041xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* nativelibs\windows_x86\
42xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* nativelibs\windows_x64\
43xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* nativelibs\linux_x86\
44xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* nativelibs\linux_x64\
45xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x86\
46xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* nativelibs\macosx_x64\
Jan Tattermuschf087ec02016-01-21 11:17:44 -080047
Jan Tattermusch24630102016-02-26 16:13:34 -080048@rem Collect protoc artifacts built by the previous build step
49xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\
50xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\
51xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\
52xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\
53xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\
54xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\
55
Jan Tattermuschf087ec02016-01-21 11:17:44 -080056@rem Fetch all dependencies
57%NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
Jan Tattermuschf087ec02016-01-21 11:17:44 -080058
Jan Tattermusch73d7fab2015-05-15 16:16:55 -070059setlocal
Jan Tattermuschf087ec02016-01-21 11:17:44 -080060
61@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
62
Jan Tattermusch24630102016-02-26 16:13:34 -080063@rem We won't use the native libraries from this step, but without this Grpc.sln will fail.
Jan Tattermuschf087ec02016-01-21 11:17:44 -080064msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
65
66msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error
67
Jan Tattermusch73d7fab2015-05-15 16:16:55 -070068endlocal
69
Jan Tattermusch48f7ed42015-07-13 21:14:17 -070070%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
Jan Tattermuschf923a2d2016-01-22 14:33:53 -080071%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error
Nicolas "Pixel" Noblef2c074a2016-08-12 03:23:10 +020072%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
Jan Tattermusch48f7ed42015-07-13 21:14:17 -070073%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error
Jan Tattermusch24630102016-02-26 16:13:34 -080074%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
Jan Tattermuschf087ec02016-01-21 11:17:44 -080075
76@rem copy resulting nuget packages to artifacts directory
77xcopy /Y /I *.nupkg ..\..\artifacts\
78
Jan Tattermusch8e90ca12016-01-29 16:30:58 -080079@rem create a zipfile with the artifacts as well
80powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
81xcopy /Y /I csharp_nugets.zip ..\..\artifacts\
82
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070083goto :EOF
84
85:error
86echo Failed!
Jan Tattermusch031c7ee2015-05-14 18:32:17 -070087exit /b %errorlevel%