2016-07-31 20:44:31 +00:00
|
|
|
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
|
2018-05-05 00:30:16 +00:00
|
|
|
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
|
2016-07-31 20:44:31 +00:00
|
|
|
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
|
2018-05-05 00:30:16 +00:00
|
|
|
REM The platform environment variable is implicitly used by msbuild;
|
|
|
|
REM we don't want it.
|
|
|
|
set platform=
|
|
|
|
dotnet restore
|
|
|
|
dotnet build -c %configuration% || goto error
|
|
|
|
|
|
|
|
echo Testing C#
|
|
|
|
dotnet run -c %configuration% -f netcoreapp1.0 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
|
|
|
dotnet run -c %configuration% -f net451 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
|
|
|
|
2016-07-31 20:44:31 +00:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:error
|
|
|
|
echo Failed!
|
|
|
|
EXIT /b %ERRORLEVEL%
|