blob: e59ebccc2a7e1a0ada992f4e0363e68e3e3b14e1 [file] [log] [blame]
Brian Silverman9c614bc2016-02-15 20:20:02 -05001setlocal
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
Austin Schuh40c16522018-10-28 20:27:54 -070013cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
Brian Silverman9c614bc2016-02-15 20:20:02 -050014msbuild 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
Austin Schuh40c16522018-10-28 20:27:54 -070022REM 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 test -c %configuration% -f netcoreapp1.0 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
30dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
31
Brian Silverman9c614bc2016-02-15 20:20:02 -050032goto :EOF
33
34:error
35echo Failed!
36EXIT /b %ERRORLEVEL%