appveyor.bat 995 B

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