blob: 7a35ceb4d678e9c028d4f7ca4cb70da64e816bb6 [file] [log] [blame]
Jan Tattermuschd4794c52015-07-15 21:21:59 -07001setlocal
2
Ivan Shynkarenkafeb183d2018-05-03 01:47:17 +03003IF %platform%==MinGW GOTO build_mingw
Jan Tattermuschd4794c52015-07-15 21:21:59 -07004IF %language%==cpp GOTO build_cpp
5IF %language%==csharp GOTO build_csharp
6
Ivan Shynkarenkafeb183d2018-05-03 01:47:17 +03007echo Unsupported language %language% and platform %platform%. Exiting.
Jan Tattermuschd4794c52015-07-15 21:21:59 -07008goto :error
9
Ivan Shynkarenkafeb183d2018-05-03 01:47:17 +030010:build_mingw
11echo Building MinGW
12set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
13mkdir build_mingw
14cd build_mingw
15cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
16mingw32-make -j8 all || goto error
17rem cd %configuration%
18rem tests.exe || goto error
19goto :EOF
20
Jan Tattermuschd4794c52015-07-15 21:21:59 -070021:build_cpp
22echo Building C++
23mkdir build_msvc
24cd build_msvc
Wei-Yin Chen (陳威尹)a7eaf362016-09-01 17:12:49 -070025cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
Jan Tattermuschd4794c52015-07-15 21:21:59 -070026msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
27cd %configuration%
28tests.exe || goto error
29goto :EOF
30
31:build_csharp
32echo Building C#
33cd csharp\src
Jon Skeetf26e8c22017-05-04 08:51:46 +010034REM The platform environment variable is implicitly used by msbuild;
35REM we don't want it.
36set platform=
Jon Skeet10a8fb42016-07-14 22:01:47 +010037dotnet restore
Jon Skeetf26e8c22017-05-04 08:51:46 +010038dotnet build -c %configuration% || goto error
Jon Skeet10a8fb42016-07-14 22:01:47 +010039
40echo Testing C#
Jan Tattermusch753daae2019-03-12 04:40:46 -040041dotnet test -c %configuration% -f netcoreapp2.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
ObsidianMinora731ecb2018-02-06 13:13:06 -060042dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
Jon Skeet10a8fb42016-07-14 22:01:47 +010043
Jan Tattermuschd4794c52015-07-15 21:21:59 -070044goto :EOF
45
46:error
47echo Failed!
Konstantin Podsvirovc3aa4c22015-10-15 02:56:48 +030048EXIT /b %ERRORLEVEL%