3 # Stop script if unbound variable found (use ${var:-} if intentional)
6 # Stop script if command returns non-zero exit code.
7 # Prevents hidden errors caused by missing error code propagation.
12 echo "Common settings:"
13 echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
14 echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
15 echo " --binaryLog Create MSBuild binary log (short: -bl)"
16 echo " --help Print help and exit (short: -h)"
20 echo " --restore Restore dependencies (short: -r)"
21 echo " --build Build solution (short: -b)"
22 echo " --rebuild Rebuild solution"
23 echo " --test Run all unit tests in the solution (short: -t)"
24 echo " --integrationTest Run all integration tests in the solution"
25 echo " --performanceTest Run all performance tests in the solution"
26 echo " --pack Package build outputs into NuGet packages and Willow components"
27 echo " --sign Sign build outputs"
28 echo " --publish Publish artifacts (e.g. symbols)"
31 echo "Advanced settings:"
32 echo " --projects <value> Project or solution file(s) to build"
33 echo " --ci Set when running on CI server"
34 echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
35 echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
36 echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
38 echo "Command line arguments not listed above are passed thru to msbuild."
39 echo "Arguments can also be passed in with a single hyphen."
42 source="${BASH_SOURCE[0]}"
44 # resolve $source until the file is no longer a symlink
45 while [[ -h "$source" ]]; do
46 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
47 source="$(readlink "$source")"
48 # if $source was a relative symlink, we need to resolve it relative to the path where the
49 # symlink file was located
50 [[ $source != /* ]] && source="$scriptroot/$source"
52 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
58 integration_test
=false
59 performance_test
=false
78 while [[ $# > 0 ]]; do
79 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
115 integration_test
=true
118 performance_test
=true
145 properties
="$properties $1"
152 if [[ "$ci" == true
]]; then
158 .
"$scriptroot/tools.sh"
160 function InitializeCustomToolset
{
161 local script="$eng_root/restore-toolset.sh"
163 if [[ -a "$script" ]]; then
170 InitializeCustomToolset
172 if [[ ! -z "$projects" ]]; then
173 properties
="$properties /p:Projects=$projects"
177 if [[ "$binary_log" == true
]]; then
178 bl
="/bl:\"$log_dir/Build.binlog\""
181 MSBuild
$_InitializeToolset \
183 /p
:Configuration
=$configuration \
184 /p
:RepoRoot
="$repo_root" \
185 /p
:Restore
=$restore \
187 /p
:Rebuild
=$rebuild \
190 /p
:IntegrationTest
=$integration_test \
191 /p
:PerformanceTest
=$performance_test \
193 /p
:Publish
=$publish \
199 if [[ "$restore" == true
&& -z ${DisableNativeToolsetInstalls:-} ]]; then
200 InitializeNativeTools