appveyor.bat 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. setlocal
  2. IF %platform%==MinGW GOTO build_mingw
  3. IF %language%==cpp GOTO build_cpp
  4. IF %language%==csharp GOTO build_csharp
  5. echo Unsupported language %language% and platform %platform%. Exiting.
  6. goto :error
  7. :build_mingw
  8. echo Building MinGW
  9. set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
  10. mkdir build_mingw
  11. cd build_mingw
  12. cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
  13. mingw32-make -j8 all || goto error
  14. rem cd %configuration%
  15. rem tests.exe || goto error
  16. goto :EOF
  17. :build_cpp
  18. echo Building C++
  19. mkdir build_msvc
  20. cd build_msvc
  21. cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
  22. msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
  23. cd %configuration%
  24. tests.exe || goto error
  25. goto :EOF
  26. :build_csharp
  27. echo Building C#
  28. cd csharp\src
  29. REM The platform environment variable is implicitly used by msbuild;
  30. REM we don't want it.
  31. set platform=
  32. dotnet restore
  33. dotnet build -c %configuration% || goto error
  34. echo Testing C#
  35. dotnet test -c %configuration% -f netcoreapp3.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
  36. dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
  37. goto :EOF
  38. :error
  39. echo Failed!
  40. EXIT /b %ERRORLEVEL%