From d4794c56b5aa26bb2765d48aa03978d6bb521a50 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 15 Jul 2015 21:21:59 -0700 Subject: [PATCH] add C# build and tests to appveyor --- appveyor.bat | 29 +++++++++++++++++++++++++++++ appveyor.yml | 12 +++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 appveyor.bat diff --git a/appveyor.bat b/appveyor.bat new file mode 100644 index 000000000..c50616f34 --- /dev/null +++ b/appveyor.bat @@ -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% \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 476a11790..3447602e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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\].*/