mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
What's changed?
- Update some nuget packages (for test projects)
- Run unit tests for supported platforms: .NET 6 + .NET Framework 4.6.2
Notes:
.NET Framework 4.6.1 is out of support, .NET Framework 4.6.2 is the older version that is still supported
https://devblogs.microsoft.com/dotnet/net-framework-4-5-2-4-6-4-6-1-will-reach-end-of-support-on-april-26-2022/
.NET 5 is out of support
https://devblogs.microsoft.com/dotnet/dotnet-5-end-of-support-update/
.NET Core 3.1 is out of support
https://devblogs.microsoft.com/dotnet/net-core-3-1-will-reach-end-of-support-on-december-13-2022/
Visual studio 2012 is out of support
https://devblogs.microsoft.com/visualstudio/support-ends-for-older-versions-of-visual-studio-feb2022
Closes #12378
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12378 from Romfos:main 227661e02c
PiperOrigin-RevId: 523196896
48 lines
1.4 KiB
Batchfile
48 lines
1.4 KiB
Batchfile
setlocal
|
|
|
|
IF %platform%==MinGW GOTO build_mingw
|
|
IF %language%==cpp GOTO build_cpp
|
|
IF %language%==csharp GOTO build_csharp
|
|
|
|
echo Unsupported language %language% and platform %platform%. Exiting.
|
|
goto :error
|
|
|
|
: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
|
|
|
|
:build_cpp
|
|
echo Building C++
|
|
mkdir build_msvc
|
|
cd build_msvc
|
|
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../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
|
|
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 test -c %configuration% -f net6.0 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
|
dotnet test -c %configuration% -f net462 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
|
|
|
|
goto :EOF
|
|
|
|
:error
|
|
echo Failed!
|
|
EXIT /b %ERRORLEVEL%
|