blob: ca88b25c3ea8eb5b12e5d87ca630c346f3566e4b [file] [log] [blame]
Artem Titov739351d2018-05-11 12:21:36 +02001setlocal
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% -Dprotobuf_UNICODE=%UNICODE% ../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
22REM The platform environment variable is implicitly used by msbuild;
23REM we don't want it.
24set platform=
25dotnet restore
26dotnet build -c %configuration% || goto error
27
28echo Testing C#
29dotnet run -c %configuration% -f netcoreapp1.0 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
30dotnet run -c %configuration% -f net451 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
31
32goto :EOF
33
34:error
35echo Failed!
36EXIT /b %ERRORLEVEL%