Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 1 | setlocal |
| 2 | |
Ivan Shynkarenka | feb183d | 2018-05-03 01:47:17 +0300 | [diff] [blame] | 3 | IF %platform%==MinGW GOTO build_mingw |
Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 4 | IF %language%==cpp GOTO build_cpp |
| 5 | IF %language%==csharp GOTO build_csharp |
| 6 | |
Ivan Shynkarenka | feb183d | 2018-05-03 01:47:17 +0300 | [diff] [blame] | 7 | echo Unsupported language %language% and platform %platform%. Exiting. |
Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 8 | goto :error |
| 9 | |
Ivan Shynkarenka | feb183d | 2018-05-03 01:47:17 +0300 | [diff] [blame] | 10 | :build_mingw |
| 11 | echo Building MinGW |
| 12 | set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=% |
| 13 | mkdir build_mingw |
| 14 | cd build_mingw |
| 15 | cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake |
| 16 | mingw32-make -j8 all || goto error |
| 17 | rem cd %configuration% |
| 18 | rem tests.exe || goto error |
| 19 | goto :EOF |
| 20 | |
Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 21 | :build_cpp |
| 22 | echo Building C++ |
| 23 | mkdir build_msvc |
| 24 | cd build_msvc |
Wei-Yin Chen (陳威尹) | a7eaf36 | 2016-09-01 17:12:49 -0700 | [diff] [blame] | 25 | cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake |
Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 26 | msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error |
| 27 | cd %configuration% |
| 28 | tests.exe || goto error |
| 29 | goto :EOF |
| 30 | |
| 31 | :build_csharp |
| 32 | echo Building C# |
| 33 | cd csharp\src |
Jon Skeet | f26e8c2 | 2017-05-04 08:51:46 +0100 | [diff] [blame] | 34 | REM The platform environment variable is implicitly used by msbuild; |
| 35 | REM we don't want it. |
| 36 | set platform= |
Jon Skeet | 10a8fb4 | 2016-07-14 22:01:47 +0100 | [diff] [blame] | 37 | dotnet restore |
Jon Skeet | f26e8c2 | 2017-05-04 08:51:46 +0100 | [diff] [blame] | 38 | dotnet build -c %configuration% || goto error |
Jon Skeet | 10a8fb4 | 2016-07-14 22:01:47 +0100 | [diff] [blame] | 39 | |
| 40 | echo Testing C# |
James Newton-King | aa15931 | 2021-11-10 08:49:53 +1300 | [diff] [blame] | 41 | dotnet test -c %configuration% -f netcoreapp3.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error |
ObsidianMinor | a731ecb | 2018-02-06 13:13:06 -0600 | [diff] [blame] | 42 | dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error |
Jon Skeet | 10a8fb4 | 2016-07-14 22:01:47 +0100 | [diff] [blame] | 43 | |
Jan Tattermusch | d4794c5 | 2015-07-15 21:21:59 -0700 | [diff] [blame] | 44 | goto :EOF |
| 45 | |
| 46 | :error |
| 47 | echo Failed! |
Konstantin Podsvirov | c3aa4c2 | 2015-10-15 02:56:48 +0300 | [diff] [blame] | 48 | EXIT /b %ERRORLEVEL% |