blob: 9a60be26b6305c8db5fe3a2d6f956d86e94b5ebe [file] [log] [blame]
Jan Tattermusch73d7fab2015-05-15 16:16:55 -07001@rem Builds gRPC NuGet packages
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -07002
Jan Tattermusch48f7ed42015-07-13 21:14:17 -07003@rem Current package versions
Nicolas "Pixel" Noble1935c362016-02-09 01:54:56 +01004set VERSION=0.14.0-dev
Jan Tattermusch72a2a7f2016-01-21 10:47:29 -08005set PROTOBUF_VERSION=3.0.0-beta2
Jan Tattermusch48f7ed42015-07-13 21:14:17 -07006
Jan Tattermuschc84c2e32015-09-02 13:58:25 -07007@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
Jan Tattermuschf6e26382015-09-22 16:43:12 -07008set VERSION_WITH_BETA=%VERSION%-beta
Jan Tattermuschc84c2e32015-09-02 13:58:25 -07009
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070010@rem Adjust the location of nuget.exe
11set NUGET=C:\nuget\nuget.exe
12
Jan Tattermuschf087ec02016-01-21 11:17:44 -080013@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 Tattermusch1afdf842016-04-07 09:30:54 -070015xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* Grpc.Core\windows_x86\
16xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* Grpc.Core\windows_x64\
17xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* Grpc.Core\linux_x86\
18xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* Grpc.Core\linux_x64\
19xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* Grpc.Core\macosx_x86\
20xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* Grpc.Core\macosx_x64\
Jan Tattermuschf087ec02016-01-21 11:17:44 -080021
Jan Tattermusch24630102016-02-26 16:13:34 -080022@rem Collect protoc artifacts built by the previous build step
23xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x86\
24xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=windows\artifacts\* protoc_plugins\windows_x64\
25xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x86\
26xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=linux\artifacts\* protoc_plugins\linux_x64\
27xcopy /Y /I ..\..\architecture=x86,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x86\
28xcopy /Y /I ..\..\architecture=x64,language=protoc,platform=macos\artifacts\* protoc_plugins\macosx_x64\
29
Jan Tattermuschf087ec02016-01-21 11:17:44 -080030@rem Fetch all dependencies
31%NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
32%NUGET% restore Grpc.sln || goto :error
33
Jan Tattermusch73d7fab2015-05-15 16:16:55 -070034setlocal
Jan Tattermuschf087ec02016-01-21 11:17:44 -080035
36@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
37
Jan Tattermusch24630102016-02-26 16:13:34 -080038@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 -080039msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
40
41msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error
42
Jan Tattermusch73d7fab2015-05-15 16:16:55 -070043endlocal
44
Jan Tattermusch48f7ed42015-07-13 21:14:17 -070045%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
Jan Tattermuschf923a2d2016-01-22 14:33:53 -080046%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error
Jan Tattermuschc84c2e32015-09-02 13:58:25 -070047%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
Jan Tattermusch48f7ed42015-07-13 21:14:17 -070048%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error
Jan Tattermusch24630102016-02-26 16:13:34 -080049%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
Jan Tattermuschf087ec02016-01-21 11:17:44 -080050
51@rem copy resulting nuget packages to artifacts directory
52xcopy /Y /I *.nupkg ..\..\artifacts\
53
Jan Tattermusch8e90ca12016-01-29 16:30:58 -080054@rem create a zipfile with the artifacts as well
55powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
56xcopy /Y /I csharp_nugets.zip ..\..\artifacts\
57
Jan Tattermuschdd95e9d2015-05-14 18:25:20 -070058goto :EOF
59
60:error
61echo Failed!
Jan Tattermusch031c7ee2015-05-14 18:32:17 -070062exit /b %errorlevel%