blob: bf831a9e3ba2d1fef8ceed234f6c322b7b2087e3 [file] [log] [blame]
Jan Tattermuschf923a2d2016-01-22 14:33:53 -08001%YAML 1.2
2--- |
3 @rem Builds gRPC NuGet packages
4
5 @rem Current package versions
6 set VERSION=${settings.version.major}.${settings.version.minor}.${settings.version.micro}
7 set PROTOBUF_VERSION=3.0.0-beta2
8
9 @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
10 set VERSION_WITH_BETA=%VERSION%-beta
11
12 @rem Adjust the location of nuget.exe
13 set NUGET=C:\nuget\nuget.exe
14
15 @rem Collect the artifacts built by the previous build step if running on Jenkins
16 @rem TODO(jtattermusch): is there a better way to do this?
17 xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=windows\artifacts\* grpc.native.csharp\windows_x86${"\\"}
18 xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=windows\artifacts\* grpc.native.csharp\windows_x64${"\\"}
19 xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=linux\artifacts\* grpc.native.csharp\linux_x86${"\\"}
20 xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=linux\artifacts\* grpc.native.csharp\linux_x64${"\\"}
21 xcopy /Y /I ..\..\architecture=x86,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x86${"\\"}
22 xcopy /Y /I ..\..\architecture=x64,language=csharp,platform=macos\artifacts\* grpc.native.csharp\macosx_x64${"\\"}
23
24 @rem Fetch all dependencies
25 %%NUGET% restore ..\..\vsprojects\grpc_csharp_ext.sln || goto :error
26 %%NUGET% restore Grpc.sln || goto :error
27
28 setlocal
29
30 @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86
31
32 @rem We won't use the native libraries from this step, but without this Grpc.sln will fail.
33 msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:Configuration=Release /p:PlatformToolset=v120 || goto :error
34
35 msbuild Grpc.sln /p:Configuration=ReleaseSigned || goto :error
36
37 endlocal
38
39 @rem TODO(jtattermusch): re-enable protoc plugin building
40 @rem @call ..\..\vsprojects\build_plugins.bat || goto :error
41
42 %%NUGET% pack grpc.native.csharp\grpc.native.csharp.nuspec -Version %VERSION% || goto :error
43 %%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
44 %%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error
45 %%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
46 %%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error
47
48 @rem TODO(jtattermusch): re-enable building Grpc.Tools package
49 @rem %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
50
51 @rem copy resulting nuget packages to artifacts directory
52 xcopy /Y /I *.nupkg ..\..\artifacts${"\\"}
53
54 goto :EOF
55
56 :error
57 echo Failed!
58 exit /b %errorlevel%