2015-07-16 04:21:59 +00:00
|
|
|
setlocal
|
|
|
|
|
2018-05-02 22:47:17 +00:00
|
|
|
IF %platform%==MinGW GOTO build_mingw
|
2015-07-16 04:21:59 +00:00
|
|
|
IF %language%==cpp GOTO build_cpp
|
|
|
|
IF %language%==csharp GOTO build_csharp
|
|
|
|
|
2018-05-02 22:47:17 +00:00
|
|
|
echo Unsupported language %language% and platform %platform%. Exiting.
|
2015-07-16 04:21:59 +00:00
|
|
|
goto :error
|
|
|
|
|
2018-05-02 22:47:17 +00:00
|
|
|
:build_mingw
|
|
|
|
echo Building MinGW
|
|
|
|
set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
|
|
|
|
mkdir build_mingw
|
|
|
|
cd build_mingw
|
|
|
|
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
|
|
|
|
mingw32-make -j8 all || goto error
|
|
|
|
rem cd %configuration%
|
|
|
|
rem tests.exe || goto error
|
|
|
|
goto :EOF
|
|
|
|
|
2015-07-16 04:21:59 +00:00
|
|
|
:build_cpp
|
|
|
|
echo Building C++
|
|
|
|
mkdir build_msvc
|
|
|
|
cd build_msvc
|
2016-09-02 00:12:49 +00:00
|
|
|
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
|
2015-07-16 04:21:59 +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
|
2017-05-04 07:51:46 +00:00
|
|
|
REM The platform environment variable is implicitly used by msbuild;
|
|
|
|
REM we don't want it.
|
|
|
|
set platform=
|
2016-07-14 21:01:47 +00:00
|
|
|
dotnet restore
|
2017-05-04 07:51:46 +00:00
|
|
|
dotnet build -c %configuration% || goto error
|
2016-07-14 21:01:47 +00:00
|
|
|
|
|
|
|
echo Testing C#
|
2018-02-06 19:13:06 +00:00
|
|
|
dotnet test -c %configuration% -f netcoreapp1.0 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
|
|
|
dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
2016-07-14 21:01:47 +00:00
|
|
|
|
2015-07-16 04:21:59 +00:00
|
|
|
goto :EOF
|
|
|
|
|
|
|
|
:error
|
|
|
|
echo Failed!
|
2015-10-14 23:56:48 +00:00
|
|
|
EXIT /b %ERRORLEVEL%
|