blob: 0beb30c19895d3156c112c1abfa1f422265e8fb8 [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 Tattermuschdd95e9d2015-05-14 18:25:20 -070030@rem Convenience script to build gRPC C# from command line
31
32setlocal
Jan Tattermuschb00aa672015-06-01 15:48:03 -070033
34@rem enter this directory
35cd /d %~dp0
36
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070037@rem Set VS variables (uses Visual Studio 2013)
38@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
39
Jon Skeetc2834092015-12-23 09:32:27 +000040@rem Fetch all dependencies
41nuget restore ..\..\vsprojects\grpc.sln || goto :error
42nuget restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
43nuget restore ..\..\vsprojects\grpc_protoc_plugins.sln || goto :error
44nuget restore Grpc.sln || goto :error
45
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070046@rem Build the C# native extension
Jan Tattermuschd2335432016-01-12 14:13:10 -080047msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Debug /p:PlatformToolset=v120 || goto :error
48msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070049
50msbuild Grpc.sln /p:Configuration=Debug || goto :error
51msbuild Grpc.sln /p:Configuration=Release || goto :error
Jan Tattermuschc463c532015-07-25 00:06:12 -070052
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070053endlocal
54
55goto :EOF
56
57:error
58echo Failed!
Jan Tattermusch031c7ee2015-05-14 18:32:17 -070059exit /b %errorlevel%