add C# build and tests to appveyor

This commit is contained in:
Jan Tattermusch 2015-07-15 21:21:59 -07:00
parent 19cf9d1e00
commit d4794c56b5
2 changed files with 34 additions and 7 deletions

29
appveyor.bat Normal file
View File

@ -0,0 +1,29 @@
setlocal
IF %language%==cpp GOTO build_cpp
IF %language%==csharp GOTO build_csharp
echo Unsupported language %language%. Exiting.
goto :error
:build_cpp
echo Building C++
mkdir build_msvc
cd build_msvc
cmake -G "%generator%" -DBUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
cd %configuration%
tests.exe || goto error
goto :EOF
:build_csharp
echo Building C#
cd csharp\src
nuget restore
msbuild ProtocolBuffers.sln /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
nunit-console ProtocolBuffers.Test\bin\%configuration%\Google.Protobuf.Test.dll || goto error
goto :EOF
:error
echo Failed!
EXIT /b %ERRORLEVEL%

View File

@ -9,7 +9,10 @@ configuration:
environment:
matrix:
- BUILD_DLL: ON
- language: cpp
BUILD_DLL: ON
- language: csharp
install:
- ps: Start-FileDownload https://googlemock.googlecode.com/files/gmock-1.7.0.zip
@ -23,12 +26,7 @@ before_build:
- if %platform%==Win64 set vcplatform=x64
build_script:
- mkdir build_msvc
- cd build_msvc
- cmake -G "%generator%" -DBUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
- msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cd %configuration%
- tests.exe
- CALL appveyor.bat
skip_commits:
message: /.*\[skip appveyor\].*/