Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 1 | @rem Copyright 2016 gRPC authors. |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 2 | @rem |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | @rem Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | @rem you may not use this file except in compliance with the License. |
| 5 | @rem You may obtain a copy of the License at |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 6 | @rem |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 7 | @rem http://www.apache.org/licenses/LICENSE-2.0 |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 8 | @rem |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | @rem Unless required by applicable law or agreed to in writing, software |
| 10 | @rem distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | @rem See the License for the specific language governing permissions and |
| 13 | @rem limitations under the License. |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 14 | |
| 15 | @rem Current package versions |
Mehrdad Afshari | 4388404 | 2018-01-19 14:25:15 -0800 | [diff] [blame] | 16 | set VERSION=1.10.0-dev |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 17 | |
| 18 | @rem Adjust the location of nuget.exe |
| 19 | set NUGET=C:\nuget\nuget.exe |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 20 | set DOTNET=dotnet |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 21 | |
| 22 | set -ex |
| 23 | |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 24 | mkdir ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 25 | |
| 26 | @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] | 27 | mkdir nativelibs |
| 28 | powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 29 | |
| 30 | @rem Collect protoc artifacts built by the previous build step |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 31 | mkdir protoc_plugins |
| 32 | powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 33 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 34 | %DOTNET% restore Grpc.sln || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 35 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 36 | @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] | 37 | 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] | 38 | |
Jan Tattermusch | 905f418 | 2017-05-23 22:34:14 +0200 | [diff] [blame] | 39 | %DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error |
| 40 | %DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error |
| 41 | %DOTNET% pack --configuration Release Grpc.Auth --output ..\..\..\artifacts || goto :error |
| 42 | %DOTNET% pack --configuration Release Grpc.HealthCheck --output ..\..\..\artifacts || goto :error |
| 43 | %DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 44 | |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame] | 45 | %NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error |
| 46 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 47 | |
| 48 | @rem copy resulting nuget packages to artifacts directory |
| 49 | xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error |
| 50 | |
| 51 | @rem create a zipfile with the artifacts as well |
| 52 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');" |
| 53 | xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error |
| 54 | |
| 55 | goto :EOF |
| 56 | |
| 57 | :error |
| 58 | echo Failed! |
| 59 | exit /b %errorlevel% |