Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 1 | @rem Builds gRPC NuGet packages |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 2 | |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 3 | @rem Current package versions |
Nicolas "Pixel" Noble | 1935c36 | 2016-02-09 01:54:56 +0100 | [diff] [blame] | 4 | set VERSION=0.14.0-dev |
Jan Tattermusch | 72a2a7f | 2016-01-21 10:47:29 -0800 | [diff] [blame] | 5 | set PROTOBUF_VERSION=3.0.0-beta2 |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 6 | |
Jan Tattermusch | c84c2e3 | 2015-09-02 13:58:25 -0700 | [diff] [blame] | 7 | @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. |
Jan Tattermusch | f6e2638 | 2015-09-22 16:43:12 -0700 | [diff] [blame] | 8 | set VERSION_WITH_BETA=%VERSION%-beta |
Jan Tattermusch | c84c2e3 | 2015-09-02 13:58:25 -0700 | [diff] [blame] | 9 | |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 10 | @rem Adjust the location of nuget.exe |
| 11 | set NUGET=C:\nuget\nuget.exe |
| 12 | |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 13 | @rem Collect the artifacts built by the previous build step if running on Jenkins |
| 14 | @rem TODO(jtattermusch): is there a better way to do this? |
Jan Tattermusch | 1afdf84 | 2016-04-07 09:30:54 -0700 | [diff] [blame] | 15 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* Grpc.Core\windows_x86\ |
| 16 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* Grpc.Core\windows_x64\ |
| 17 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* Grpc.Core\linux_x86\ |
| 18 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* Grpc.Core\linux_x64\ |
| 19 | xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* Grpc.Core\macosx_x86\ |
| 20 | xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* Grpc.Core\macosx_x64\ |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 21 | |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 22 | @rem Collect protoc artifacts built by the previous build step |
| 23 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\ |
| 24 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\ |
| 25 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\ |
| 26 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\ |
| 27 | xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\ |
| 28 | xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\ |
| 29 | |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 30 | @rem Fetch all dependencies |
| 31 | %NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error |
| 32 | %NUGET% restore Grpc.sln || goto :error |
| 33 | |
Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 34 | setlocal |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 35 | |
| 36 | @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 |
| 37 | |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 38 | @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] | 39 | msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error |
| 40 | |
| 41 | msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error |
| 42 | |
Jan Tattermusch | 73d7fab | 2015-05-15 16:16:55 -0700 | [diff] [blame] | 43 | endlocal |
| 44 | |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 45 | %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error |
Jan Tattermusch | f923a2d | 2016-01-22 14:33:53 -0800 | [diff] [blame] | 46 | %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error |
Jan Tattermusch | c84c2e3 | 2015-09-02 13:58:25 -0700 | [diff] [blame] | 47 | %NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error |
Jan Tattermusch | 48f7ed4 | 2015-07-13 21:14:17 -0700 | [diff] [blame] | 48 | %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error |
Jan Tattermusch | 2463010 | 2016-02-26 16:13:34 -0800 | [diff] [blame] | 49 | %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error |
Jan Tattermusch | f087ec0 | 2016-01-21 11:17:44 -0800 | [diff] [blame] | 50 | |
| 51 | @rem copy resulting nuget packages to artifacts directory |
| 52 | xcopy /Y /I *.nupkg ..\..\artifacts\ |
| 53 | |
Jan Tattermusch | 8e90ca1 | 2016-01-29 16:30:58 -0800 | [diff] [blame] | 54 | @rem create a zipfile with the artifacts as well |
| 55 | powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');" |
| 56 | xcopy /Y /I csharp_nugets.zip ..\..\artifacts\ |
| 57 | |
Jan Tattermusch | dd95e9d | 2015-05-14 18:25:20 -0700 | [diff] [blame] | 58 | goto :EOF |
| 59 | |
| 60 | :error |
| 61 | echo Failed! |
Jan Tattermusch | 031c7ee | 2015-05-14 18:32:17 -0700 | [diff] [blame] | 62 | exit /b %errorlevel% |