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)"
29 echo " --clean Clean the solution"
32 echo "Advanced settings:"
33 echo " --projects <value> Project or solution file(s) to build"
34 echo " --ci Set when running on CI server"
35 echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
36 echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
37 echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
39 echo "Command line arguments not listed above are passed thru to msbuild."
40 echo "Arguments can also be passed in with a single hyphen."
43 source="${BASH_SOURCE[0]}"
45 # resolve $source until the file is no longer a symlink
46 while [[ -h "$source" ]]; do
47 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
48 source="$(readlink "$source")"
49 # if $source was a relative symlink, we need to resolve it relative to the path where the
50 # symlink file was located
51 [[ $source != /* ]] && source="$scriptroot/$source"
53 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
59 integration_test
=false
60 performance_test
=false
80 while [[ $# > 0 ]]; do
81 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
120 integration_test
=true
123 performance_test
=true
150 properties
="$properties $1"
157 if [[ "$ci" == true
]]; then
163 .
"$scriptroot/tools.sh"
165 function InitializeCustomToolset
{
166 local script="$eng_root/restore-toolset.sh"
168 if [[ -a "$script" ]]; then
175 InitializeCustomToolset
177 if [[ ! -z "$projects" ]]; then
178 properties
="$properties /p:Projects=$projects"
182 if [[ "$binary_log" == true
]]; then
183 bl
="/bl:\"$log_dir/Build.binlog\""
186 MSBuild
$_InitializeToolset \
188 /p
:Configuration
=$configuration \
189 /p
:RepoRoot
="$repo_root" \
190 /p
:Restore
=$restore \
192 /p
:Rebuild
=$rebuild \
195 /p
:IntegrationTest
=$integration_test \
196 /p
:PerformanceTest
=$performance_test \
198 /p
:Publish
=$publish \
204 if [[ "$clean" == true
]]; then
205 if [ -d "$artifacts_dir" ]; then
206 rm -rf $artifacts_dir
207 echo "Artifacts directory deleted."
212 if [[ "$restore" == true
]]; then
213 InitializeNativeTools