1ffe3c632Sopenharmony_cisetlocal
2ffe3c632Sopenharmony_ci
3ffe3c632Sopenharmony_ciIF %platform%==MinGW GOTO build_mingw
4ffe3c632Sopenharmony_ciIF %language%==cpp GOTO build_cpp
5ffe3c632Sopenharmony_ciIF %language%==csharp GOTO build_csharp
6ffe3c632Sopenharmony_ci
7ffe3c632Sopenharmony_ciecho Unsupported language %language% and platform %platform%. Exiting.
8ffe3c632Sopenharmony_cigoto :error
9ffe3c632Sopenharmony_ci
10ffe3c632Sopenharmony_ci:build_mingw
11ffe3c632Sopenharmony_ciecho Building MinGW
12ffe3c632Sopenharmony_ciset PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=%
13ffe3c632Sopenharmony_cimkdir build_mingw
14ffe3c632Sopenharmony_cicd build_mingw
15ffe3c632Sopenharmony_cicmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=0 ../cmake
16ffe3c632Sopenharmony_cimingw32-make -j8 all || goto error
17ffe3c632Sopenharmony_cirem cd %configuration%
18ffe3c632Sopenharmony_cirem tests.exe || goto error
19ffe3c632Sopenharmony_cigoto :EOF
20ffe3c632Sopenharmony_ci
21ffe3c632Sopenharmony_ci:build_cpp
22ffe3c632Sopenharmony_ciecho Building C++
23ffe3c632Sopenharmony_cimkdir build_msvc
24ffe3c632Sopenharmony_cicd build_msvc
25ffe3c632Sopenharmony_cicmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
26ffe3c632Sopenharmony_cimsbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
27ffe3c632Sopenharmony_cicd %configuration%
28ffe3c632Sopenharmony_citests.exe || goto error
29ffe3c632Sopenharmony_cigoto :EOF
30ffe3c632Sopenharmony_ci
31ffe3c632Sopenharmony_ci:build_csharp
32ffe3c632Sopenharmony_ciecho Building C#
33ffe3c632Sopenharmony_cicd csharp\src
34ffe3c632Sopenharmony_ciREM The platform environment variable is implicitly used by msbuild;
35ffe3c632Sopenharmony_ciREM we don't want it.
36ffe3c632Sopenharmony_ciset platform=
37ffe3c632Sopenharmony_cidotnet restore
38ffe3c632Sopenharmony_cidotnet build -c %configuration% || goto error
39ffe3c632Sopenharmony_ci
40ffe3c632Sopenharmony_ciecho Testing C#
41ffe3c632Sopenharmony_cidotnet test -c %configuration% -f netcoreapp2.1 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
42ffe3c632Sopenharmony_cidotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
43ffe3c632Sopenharmony_ci
44ffe3c632Sopenharmony_cigoto :EOF
45ffe3c632Sopenharmony_ci
46ffe3c632Sopenharmony_ci:error
47ffe3c632Sopenharmony_ciecho Failed!
48ffe3c632Sopenharmony_ciEXIT /b %ERRORLEVEL%
49