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 | 4ecc5d8 | 2018-05-14 22:42:39 -0700 | [diff] [blame] | 16 | set VERSION=1.12.0 |
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 | |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 22 | mkdir ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 23 | |
| 24 | @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] | 25 | mkdir nativelibs |
Jan Tattermusch | 5f3a452 | 2018-03-13 11:04:51 +0100 | [diff] [blame] | 26 | @rem Jenkins flow (deprecated) |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 27 | powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs" |
Jan Tattermusch | 5f3a452 | 2018-03-13 11:04:51 +0100 | [diff] [blame] | 28 | @rem Kokoro flow |
| 29 | powershell -Command "cp -r ..\..\input_artifacts\csharp_ext_* nativelibs" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 30 | |
| 31 | @rem Collect protoc artifacts built by the previous build step |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 32 | mkdir protoc_plugins |
Jan Tattermusch | 5f3a452 | 2018-03-13 11:04:51 +0100 | [diff] [blame] | 33 | @rem Jenkins flow (deprecated) |
Jan Tattermusch | d71a631 | 2017-04-21 17:33:40 +0200 | [diff] [blame] | 34 | powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins" |
Jan Tattermusch | 5f3a452 | 2018-03-13 11:04:51 +0100 | [diff] [blame] | 35 | @rem Kokoro flow |
| 36 | powershell -Command "cp -r ..\..\input_artifacts\protoc_* protoc_plugins" |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 37 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 38 | %DOTNET% restore Grpc.sln || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 39 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 40 | @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] | 41 | 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] | 42 | |
Jan Tattermusch | 905f418 | 2017-05-23 22:34:14 +0200 | [diff] [blame] | 43 | %DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error |
| 44 | %DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error |
| 45 | %DOTNET% pack --configuration Release Grpc.Auth --output ..\..\..\artifacts || goto :error |
| 46 | %DOTNET% pack --configuration Release Grpc.HealthCheck --output ..\..\..\artifacts || goto :error |
| 47 | %DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 48 | |
Jan Tattermusch | d890b25 | 2016-11-29 11:05:18 +0100 | [diff] [blame] | 49 | %NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error |
| 50 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts |
Alexander Polcyn | 84be265 | 2016-10-27 23:52:16 -0700 | [diff] [blame] | 51 | |
| 52 | @rem copy resulting nuget packages to artifacts directory |
| 53 | xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error |
| 54 | |
| 55 | @rem create a zipfile with the artifacts as well |
| 56 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');" |
| 57 | xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error |
| 58 | |
| 59 | goto :EOF |
| 60 | |
| 61 | :error |
| 62 | echo Failed! |
| 63 | exit /b %errorlevel% |