Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1 | setlocal |
| 2 | |
| 3 | IF %language%==cpp GOTO build_cpp |
| 4 | IF %language%==csharp GOTO build_csharp |
| 5 | |
| 6 | echo Unsupported language %language%. Exiting. |
| 7 | goto :error |
| 8 | |
| 9 | :build_cpp |
| 10 | echo Building C++ |
| 11 | mkdir build_msvc |
| 12 | cd build_msvc |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame] | 13 | cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 14 | msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error |
| 15 | cd %configuration% |
| 16 | tests.exe || goto error |
| 17 | goto :EOF |
| 18 | |
| 19 | :build_csharp |
| 20 | echo Building C# |
| 21 | cd csharp\src |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame] | 22 | REM The platform environment variable is implicitly used by msbuild; |
| 23 | REM we don't want it. |
| 24 | set platform= |
| 25 | dotnet restore |
| 26 | dotnet build -c %configuration% || goto error |
| 27 | |
| 28 | echo Testing C# |
| 29 | dotnet test -c %configuration% -f netcoreapp1.0 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error |
| 30 | dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error |
| 31 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 32 | goto :EOF |
| 33 | |
| 34 | :error |
| 35 | echo Failed! |
| 36 | EXIT /b %ERRORLEVEL% |