f26e8c2ae0
This has one important packaging change: the netstandard version now depends (implicitly) on netstandard1.6.1 rather than on individual packages. This is the preferred style of dependency, and shouldn't affect any users - see http://stackoverflow.com/questions/42946951 for details. The tests are still NUnit, but NUnit doesn't support "dotnet test" yet; the test project is now an executable using NUnitLite. (When NUnit supports dotnet test, we can adapt to it.) Note that the project will now only work in Visual Studio 2017 (and Visual Studio Code, and from the command line with the .NET Core 1.0.0 SDK); Visual Studio 2015 does *not* support this project file format.
37 lines
995 B
Batchfile
37 lines
995 B
Batchfile
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%" -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 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
|
|
|
|
goto :EOF
|
|
|
|
:error
|
|
echo Failed!
|
|
EXIT /b %ERRORLEVEL%
|