1setlocal
2
3IF %language%==cpp GOTO build_cpp
4IF %language%==csharp GOTO build_csharp
5
6echo Unsupported language %language%. Exiting.
7goto :error
8
9:build_cpp
10echo Building C++
11mkdir build_msvc
12cd build_msvc
13cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
14msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
15cd %configuration%
16tests.exe || goto error
17goto :EOF
18
19:build_csharp
20echo Building C#
21cd csharp\src
22nuget restore
23msbuild Google.Protobuf.sln /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
24nunit-console Google.Protobuf.Test\bin\%configuration%\Google.Protobuf.Test.dll || goto error
25goto :EOF
26
27:error
28echo Failed!
29EXIT /b %ERRORLEVEL%
30