Skip to content

Commit d4794c5

Browse files
committed
add C# build and tests to appveyor
1 parent 19cf9d1 commit d4794c5

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

appveyor.bat

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
setlocal
2+
3+
IF %language%==cpp GOTO build_cpp
4+
IF %language%==csharp GOTO build_csharp
5+
6+
echo Unsupported language %language%. Exiting.
7+
goto :error
8+
9+
:build_cpp
10+
echo Building C++
11+
mkdir build_msvc
12+
cd build_msvc
13+
cmake -G "%generator%" -DBUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
14+
msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
15+
cd %configuration%
16+
tests.exe || goto error
17+
goto :EOF
18+
19+
:build_csharp
20+
echo Building C#
21+
cd csharp\src
22+
nuget restore
23+
msbuild ProtocolBuffers.sln /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
24+
nunit-console ProtocolBuffers.Test\bin\%configuration%\Google.Protobuf.Test.dll || goto error
25+
goto :EOF
26+
27+
:error
28+
echo Failed!
29+
EXIT /b %ERRORLEVEL%

appveyor.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ configuration:
99

1010
environment:
1111
matrix:
12-
- BUILD_DLL: ON
12+
- language: cpp
13+
BUILD_DLL: ON
14+
15+
- language: csharp
1316

1417
install:
1518
- ps: Start-FileDownload https://googlemock.googlecode.com/files/gmock-1.7.0.zip
@@ -23,12 +26,7 @@ before_build:
2326
- if %platform%==Win64 set vcplatform=x64
2427

2528
build_script:
26-
- mkdir build_msvc
27-
- cd build_msvc
28-
- cmake -G "%generator%" -DBUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
29-
- msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
30-
- cd %configuration%
31-
- tests.exe
29+
- CALL appveyor.bat
3230

3331
skip_commits:
3432
message: /.*\[skip appveyor\].*/

0 commit comments

Comments
 (0)