Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build_windows.bat « azure-pipelines « .ci - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 533228c83938a6767c5066d0437a8d246d8834fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
:: Copyright 2020-2021 The Mumble Developers. All rights reserved.
:: Use of this source code is governed by a BSD-style license
:: that can be found in the LICENSE file at the root of the
:: Mumble source tree or at <https://www.mumble.info/LICENSE>.
::
:: Builds Mumble using the specified build script.
:: The path to the script is relative to the build environment's root.
:: The configuration we build with is adjusted to be close to
:: our release builds.
::
:: Below is a list of configuration variables used from environment.
::
:: Predefined variables:
::
::  BUILD_BINARIESDIRECTORY      - The local path on the agent that can be used
::                                 as an output folder for compiled binaries.
::  BUILD_SOURCESDIRECTORY       - The local path on the agent where the
::                                 repository is downloaded.
::  AGENT_TOOLSDIRECTORY         - The directory used by tasks such as
::                                 Node Tool Installer and Use Python Version
::                                 to switch between multiple versions of a tool.
::                                 We store Wix# there, in "WixSharp".
::
:: Defined in .azure-pipelines.yml:
::
::  MUMBLE_ENVIRONMENT_PATH      - Path to the environment's root directory.
::  MUMBLE_ENVIRONMENT_TOOLCHAIN - Path to the vcpkg CMake toolchain, used for CMake.
::  MUMBLE_ENVIRONMENT_TRIPLET   - vcpkg triplet.
::  VCVARS_PATH                  - Path to the Visual Studio environment initialization script.
::
:: Defined on Azure Pipelines:
::
::  MUMBLE_BUILD_NUMBER_TOKEN           - Access token for the build number page on our server.
::

@echo on

:: The method we use to store a command's output into a variable:
:: https://stackoverflow.com/a/6362922
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py" --format version`) do (set "VERSION=%%g")

:: For some really stupid reason we can't have this statement and the one where we set the VERSION variable in the same if body as
:: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string)
:: Also we can't anything else inside the if body as this will cause the curl command to always be executed.
if defined MUMBLE_BUILD_NUMBER_TOKEN (
	for /f "tokens=* USEBACKQ" %%g in (`curl "https://mumble.info/get-build-number?commit=%BUILD_SOURCEVERSION%&version=%VERSION%&token=%MUMBLE_BUILD_NUMBER_TOKEN%"`) do (set "BUILD_NUMBER=%%g")
) else (
	echo Build number token not set - defaulting to 0
	set BUILD_NUMBER=0
)

for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "RELEASE_ID=%%g")

cd /d %BUILD_BINARIESDIRECTORY%

call "%VCVARS_PATH%"

set PATH=%PATH%;%AGENT_TOOLSDIRECTORY%\WixSharp

:: Delete MinGW, otherwise CMake picks it over MSVC.
:: We don't delete the (Chocolatey) packages because it takes ~10 minutes...
del C:\ProgramData\chocolatey\bin\gcc.exe
del C:\ProgramData\chocolatey\bin\g++.exe
del C:\ProgramData\chocolatey\bin\c++.exe
del C:\Strawberry\c\bin\gcc.exe
del C:\Strawberry\c\bin\g++.exe
del C:\Strawberry\c\bin\c++.exe

cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^
      -DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^
      -DCMAKE_BUILD_TYPE=Release -DRELEASE_ID=%RELEASE_ID% -DBUILD_NUMBER=%BUILD_NUMBER% ^
      -Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^
      -Ddisplay-install-paths=ON "%BUILD_SOURCESDIRECTORY%"

if errorlevel 1 (
	exit /b %errorlevel%
)

cmake --build .

if errorlevel 1 (
	exit /b %errorlevel%
)

:: Set timeout for tests to 15min
set QTEST_FUNCTION_TIMEOUT=900000
ctest --verbose

if errorlevel 1 (
	exit /b %errorlevel%
)

cmake --install .

if errorlevel 1 (
	exit /b %errorlevel%
)

copy installer\client\mumble_client*.msi %BUILD_ARTIFACTSTAGINGDIRECTORY%

copy installer\server\mumble_server*.msi %BUILD_ARTIFACTSTAGINGDIRECTORY%

7z a PDBs.7z *.pdb plugins\*.pdb
copy PDBs.7z %BUILD_ARTIFACTSTAGINGDIRECTORY%