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 " --help Print help and exit (short: -h)"
18 echo " --pack Package build outputs into NuGet packages"
19 echo " --test Run all unit tests in the solution (short: -t)"
20 echo " --rebuild Run ../.autogen.sh"
21 echo " --skipnative Do not build runtime"
22 echo " --skipmscorlib Do not build System.Private.CoreLib"
25 echo "Command line arguments starting with '/p:' are passed through to MSBuild."
26 echo "Arguments can also be passed in with a single hyphen."
37 while [[ $# > 0 ]]; do
38 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
45 properties
="$properties $1 $2"
65 properties
="$properties $1"
68 properties
="$properties $1"
71 properties
="$properties $1"
74 properties
="$properties $1"
77 echo "Invalid argument: $1"
86 CPU_COUNT
=$
(getconf _NPROCESSORS_ONLN ||
echo 4)
88 # run .././autogen.sh only once or if "--rebuild" argument is provided
89 if [[ "$force_rebuild" == "true" ||
! -f .configured
]]; then
90 (cd ..
&& .
/autogen.sh
--with-core=only
)
95 if [ "$skipnative" = "false" ]; then
96 make runtime
-j$CPU_COUNT
99 # build System.Private.CoreLib (../mcs/class/System.Private.CoreLib)
100 if [ "$skipmscorlib" = "false" ]; then
101 make bcl CORLIB_BUILD_FLAGS
="$properties"
104 # create a nupkg with runtime and System.Private.CoreLib
105 if [ "$pack" = "true" ]; then
109 # run all xunit tests
110 if [ "$test" = "true" ]; then
111 for testdir
in corefx
/tests
/extracted
/*; do
112 ..
/scripts
/ci
/.
/run-step.sh
--label=$
(basename $testdir) --timeout=15m
make run-tests-corefx-$
(basename $testdir)