1 @if not defined _echo @echo off
2 setlocal EnableDelayedExpansion
4 :: Set the default arguments for build
6 set __VCBuildArch=x86_amd64
8 set __BuildOS=Windows_NT
10 :: Default to highest Visual Studio version available
12 :: For VS2015 (and prior), only a single instance is allowed to be installed on a box
13 :: and VS140COMNTOOLS is set as a global environment variable by the installer. This
14 :: allows users to locate where the instance of VS2015 is installed.
16 :: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
17 :: is no longer set as a global environment variable and is instead only set if the user
18 :: has launched the VS2017 Developer Command Prompt.
20 :: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
21 :: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
22 :: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
23 :: toolset if it is installed. Finally, we will fail the script if no supported VS instance
25 if defined VisualStudioVersion goto :Run
27 set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
29 for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
31 if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS%
32 if not exist "%_VSCOMNTOOLS%" (
33 echo Error: Visual Studio 2015 or 2017 required.
34 echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
38 call "%_VSCOMNTOOLS%\VsDevCmd.bat"
42 if defined VS150COMNTOOLS (
43 set "__VSToolsRoot=%VS150COMNTOOLS%"
44 set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
45 set __VSVersion=vs2017
47 set "__VSToolsRoot=%VS140COMNTOOLS%"
48 set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
49 set __VSVersion=vs2015
52 :: Define a prefix for most output progress messages that come from this script. That makes
53 :: it easier to see where these are coming from. Note that there is a trailing space here.
54 set __MsgPrefix=BUILDTEST:
56 set "__ProjectDir=%~dp0"
57 :: remove trailing slash
58 if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
59 set "__TestDir=%__ProjectDir%\tests"
60 set "__ProjectFilesDir=%__TestDir%"
61 set "__SourceDir=%__ProjectDir%\src"
62 set "__PackagesDir=%__ProjectDir%\packages"
63 set "__RootBinDir=%__ProjectDir%\bin"
64 set "__LogsDir=%__RootBinDir%\Logs"
66 :: Default __Exclude to issues.targets
67 set __Exclude=%__TestDir%\issues.targets
69 REM __unprocessedBuildArgs are args that we pass to msbuild (e.g. /p:__BuildArch=x64)
72 set __unprocessedBuildArgs=
74 set __BuildAgainstPackagesArg=
77 set __TargetsWindows=1
81 if "%1" == "" goto ArgsDone
83 if /i "%1" == "-?" goto Usage
84 if /i "%1" == "-h" goto Usage
85 if /i "%1" == "-help" goto Usage
87 if /i "%1" == "x64" (set __BuildArch=x64&set __VCBuildArch=x86_amd64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
88 if /i "%1" == "x86" (set __BuildArch=x86&set __VCBuildArch=x86&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
89 if /i "%1" == "arm" (set __BuildArch=arm&set __VCBuildArch=x86_arm&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
90 if /i "%1" == "arm64" (set __BuildArch=arm64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
92 if /i "%1" == "debug" (set __BuildType=Debug&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
93 if /i "%1" == "release" (set __BuildType=Release&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
94 if /i "%1" == "checked" (set __BuildType=Checked&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
96 if /i "%1" == "skipmanaged" (set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
97 if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
98 if /i "%1" == "buildagainstpackages" (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
99 if /i "%1" == "ziptests" (set __ZipTests=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
100 if /i "%1" == "crossgen" (set __DoCrossgen=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
101 if /i "%1" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
102 if /i "%1" == "targetsNonWindows" (set __TargetsWindows=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
103 if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
105 if [!processedArgs!]==[] (
106 set __UnprocessedBuildArgs=%__args%
108 set __UnprocessedBuildArgs=%__args%
109 for %%t in (!processedArgs!) do (
110 set __UnprocessedBuildArgs=!__UnprocessedBuildArgs:*%%t=!
116 if defined __BuildAgainstPackagesArg (
117 if not defined __RuntimeID (
118 echo %__MsgPrefix%Error: When building against packages, you must supply a target Runtime ID.
123 echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat"
124 call "%__VSToolsRoot%\VsDevCmd.bat"
125 @if defined _echo @echo on
127 set __RunArgs=-BuildOS=%__BuildOS% -BuildType=%__BuildType% -BuildArch=%__BuildArch%
129 rem arm64 builds currently use private toolset which has not been released yet
130 REM TODO, remove once the toolset is open.
131 if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
133 echo %__MsgPrefix%Commencing CoreCLR repo test build
135 set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
136 set "__TestRootDir=%__RootBinDir%\tests"
137 set "__TestBinDir=%__TestRootDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
138 :: We have different managed and native intermediate dirs because the managed bits will include
139 :: the configuration information deeper in the intermediates path.
140 :: These variables are used by the msbuild project files.
142 if not defined __TestIntermediateDir (
143 set "__TestIntermediateDir=tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
145 set "__NativeTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Native"
146 set "__ManagedTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Managed"
148 :: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
149 set "__CMakeBinDir=%__TestBinDir%"
150 set "__CMakeBinDir=%__CMakeBinDir:\=/%"
152 if not exist "%__TestBinDir%" md "%__TestBinDir%"
153 if not exist "%__NativeTestIntermediatesDir%" md "%__NativeTestIntermediatesDir%"
154 if not exist "%__ManagedTestIntermediatesDir%" md "%__ManagedTestIntermediatesDir%"
155 if not exist "%__LogsDir%" md "%__LogsDir%"
157 echo %__MsgPrefix%Checking prerequisites
159 :: Eval the output from probe-win1.ps1
160 for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
162 REM =========================================================================================
164 REM === Restore Build Tools
166 REM =========================================================================================
167 call "%__ProjectDir%\init-tools.cmd"
168 @if defined _echo @echo on
170 REM =========================================================================================
172 REM === Resolve runtime dependences
174 REM =========================================================================================
176 call "%__TestDir%\setup-stress-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
177 @if defined _echo @echo on
179 REM =========================================================================================
181 REM === Native test build section
183 REM =========================================================================================
185 echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType%
187 if defined __ToolsetDir (
188 echo %__MsgPrefix%ToolsetDir is defined to be :%__ToolsetDir%
189 goto GenVSSolution :: Private ToolSet is Defined
192 :: Set the environment for the native build
193 echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch%
194 call "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch%
195 @if defined _echo @echo on
197 if not defined VSINSTALLDIR (
198 echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
201 if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA
205 pushd "%__NativeTestIntermediatesDir%"
206 call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" ""%__ProjectFilesDir%"" %__VSVersion% %__BuildArch%
207 @if defined _echo @echo on
210 if not exist "%__NativeTestIntermediatesDir%\install.vcxproj" (
211 echo %__MsgPrefix%Failed to generate test native component build project!
215 set __msbuildNativeArgs=-configuration=%__BuildType%
217 if defined __ToolsetDir (
218 set __msbuildNativeArgs=%__msbuildNativeArgs% -UseEnv
220 set __msbuildNativeArgs=%__msbuildNativeArgs% -platform=%__BuildArch%
223 set __BuildLogRootName=Tests_Native
224 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
225 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
226 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
227 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
228 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
229 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
231 call "%__ProjectDir%\run.cmd" build -Project="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__unprocessedBuildArgs%
233 echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
242 set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
244 if not defined __BuildAgainstPackagesArg goto SkipRestoreProduct
245 REM =========================================================================================
247 REM === Restore product binaries from packages
249 REM =========================================================================================
251 if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
252 set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
254 set __BuildLogRootName=Restore_Product
255 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
256 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
257 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
258 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
259 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
260 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
262 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
264 set __BuildLogRootName=Tests_GenerateRuntimeLayout
265 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
266 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
267 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
268 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
269 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
270 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
272 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
274 echo BinPlace of mscorlib.dll failed
278 echo %__MsgPrefix% Restored CoreCLR product from packages
282 if defined __SkipManaged exit /b 0
284 REM =========================================================================================
286 REM === Managed test build section
288 REM =========================================================================================
290 echo %__MsgPrefix%Starting the Managed Tests Build
292 if not defined VSINSTALLDIR (
293 echo %__MsgPrefix%Error: build-test.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
297 set __BuildLogRootName=Tests_Managed
298 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
299 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
300 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
301 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
302 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
303 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
305 call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
307 echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
314 REM Prepare the Test Drop
315 REM Cleans any NI from the last run
316 powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
317 REM Cleans up any lock folder used for synchronization from last run
318 powershell "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force | where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
320 set CORE_ROOT=%__TestBinDir%\Tests\Core_Root
321 set CORE_ROOT_STAGE=%__TestBinDir%\Tests\Core_Root_Stage
322 if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%"
323 if exist "%CORE_ROOT_STAGE%" rd /s /q "%CORE_ROOT_STAGE%"
325 md "%CORE_ROOT_STAGE%"
326 xcopy "%__BinDir%" "%CORE_ROOT_STAGE%"
329 if defined __BuildAgainstPackagesArg (
330 if "%__TargetsWindows%"=="0" (
332 if not exist %__PackagesDir%\TestNativeBins (
333 echo %__MsgPrefix%Error: Ensure you have run sync.cmd -ab before building a non-Windows test overlay against packages
337 for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.so) do copy %%f %CORE_ROOT_STAGE%
338 for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.dylib) do copy %%f %CORE_ROOT_STAGE%
342 echo %__MsgPrefix%Creating test wrappers...
345 set TargetsWindowsArg=
347 if defined __RuntimeId (
348 set RuntimeIdArg=-RuntimeID="%__RuntimeId%"
351 if "%__TargetsWindows%"=="1" (
352 set TargetsWindowsArg=-TargetsWindows=true
353 ) else if "%__TargetsWindows%"=="0" (
354 set TargetsWindowsArg=-TargetsWindows=false
357 set __BuildLogRootName=Tests_XunitWrapper
358 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
359 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
360 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
361 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
362 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
363 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
365 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %TargetsWindowsArg% %__unprocessedBuildArgs%
367 echo Xunit Wrapper build failed
371 echo %__MsgPrefix%Creating test overlay...
373 set __BuildLogRootName=Tests_Overlay_Managed
374 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
375 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
376 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
377 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
378 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
379 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
381 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__unprocessedBuildArgs%
383 echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
390 xcopy /s /y "%CORE_ROOT_STAGE%" "%CORE_ROOT%"
392 set __CrossgenArg = ""
393 if defined __DoCrossgen (
394 set __CrossgenArg="-Crossgen"
395 if "%__TargetsWindows%" == "1" (
398 echo "%__MsgPrefix% Crossgen only supported on Windows, for now"
402 rd /s /q "%CORE_ROOT_STAGE%"
404 if not defined __ZipTests goto SkipPrepForPublish
406 set __BuildLogRootName=Helix_Prep
407 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
408 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
409 set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
410 set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
411 set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
412 set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
414 REM =========================================================================================
416 REM === Prep test binaries for Helix publishing
418 REM =========================================================================================
420 call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %RuntimeIdArg% %TargetsWindowsArg% %__CrossgenArg% %__unprocessedBuildArgs%
422 echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
429 echo %__MsgPrefix% Prepped test binaries for publishing
433 REM =========================================================================================
435 REM === All builds complete!
437 REM =========================================================================================
439 echo %__MsgPrefix%Test build successful.
440 echo %__MsgPrefix%Test binaries are available at !__TestBinDir!
446 echo %0 [option1] [option2] ...
447 echo All arguments are optional. Options are case-insensitive. The options are:
449 echo. -? -h -help: view this message.
450 echo Build architecture: -buildArch: only x64 is currently allowed ^(default: x64^).
451 echo Build type: -buildType: one of Debug, Checked, Release ^(default: Debug^).
452 echo buildagainstpackages: builds tests against restored packages, instead of against a built product.
453 echo runtimeid ^<ID^>: Builds a test overlay for the specified OS (Only supported when building against packages). Supported IDs are:
454 echo alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3
455 echo debian.8-x64: Builds overlay for Debian 8
456 echo fedora.24-x64: Builds overlay for Fedora 24
457 echo linux-x64: Builds overlay for portable linux
458 echo opensuse.42.1-x64: Builds overlay for OpenSUSE 42.1
459 echo osx.10.12-x64: Builds overlay for OSX 10.12
460 echo osx-x64: Builds overlay for portable OSX
461 echo rhel.7-x64: Builds overlay for RHEL 7 or CentOS
462 echo ubuntu.14.04-x64: Builds overlay for Ubuntu 14.04
463 echo ubuntu.16.04-x64: Builds overlay for Ubuntu 16.04
464 echo ubuntu.16.10-x64: Builds overlay for Ubuntu 16.10
465 echo win-x64: Builds overlay for portable Windows
466 echo win7-x64: Builds overlay for Windows 7
467 echo ziptests: zips CoreCLR tests & Core_Root for a Helix run
468 echo crossgen: Precompiles the framework managed assemblies
469 echo Exclude- Optional parameter - specify location of default exclusion file (defaults to tests\issues.targets if not specified)
470 echo Set to "" to disable default exclusion file.
471 echo -- ... : all arguments following this tag will be passed directly to msbuild.
472 echo -priority=^<N^> : specify a set of test that will be built and run, with priority N.
473 echo 0: Build only priority 0 cases as essential testcases (default)
474 echo 1: Build all tests with priority 0 and 1
475 echo 666: Build all tests with priority 0, 1 ... 666
476 echo -verbose: enables detailed file logging for the msbuild tasks into the msbuild log file.
480 echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
481 This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
482 at the install location of previous Visual Studio version. The workaround is to copy the DIA SDK folder from the Visual Studio install location ^
483 of the previous version to "%VSINSTALLDIR%" and then build.
484 :: DIA SDK not included in Express editions
485 echo Visual Studio Express does not include the DIA SDK. ^
486 You need Visual Studio 2015 or 2017 (Community is free).
487 echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
493 echo %__MsgPrefix% Setting Up the usage of __ToolsetDir:%__ToolsetDir%
495 if /i "%__ToolsetDir%" == "" (
496 echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
500 if not exist "%__ToolsetDir%"\buildenv_arm64.cmd goto :Not_EWDK
501 call "%__ToolsetDir%"\buildenv_arm64.cmd
505 set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
506 set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
508 %__ToolsetDir%\VC_sdk\inc;^
509 %__ToolsetDir%\sdpublic\sdk\inc;^
510 %__ToolsetDir%\sdpublic\shared\inc;^
511 %__ToolsetDir%\sdpublic\shared\inc\minwin;^
512 %__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
513 %__ToolsetDir%\sdpublic\sdk\inc\minwin;^
514 %__ToolsetDir%\sdpublic\sdk\inc\mincore;^
515 %__ToolsetDir%\sdpublic\sdk\inc\abi;^
516 %__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
517 %__ToolsetDir%\diasdk\include
521 for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%%F" %%~nF%%~xF
524 REM Compile the managed assemblies in Core_ROOT before running the tests
527 REM Skip mscorlib since it is already precompiled.
528 if /I "%2" == "mscorlib.dll" exit /b 0
529 if /I "%2" == "mscorlib.ni.dll" exit /b 0
530 REM don't precompile anything from CoreCLR
531 if /I exist %CORE_ROOT_STAGE%\%2 exit /b 0
533 "%CORE_ROOT_STAGE%\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" /in "%1" /out "%CORE_ROOT%/temp.ni.dll" >nul 2>nul
534 set /a __exitCode = %errorlevel%
535 if "%__exitCode%" == "-2146230517" (
536 echo %2 is not a managed assembly.
540 if %__exitCode% neq 0 (
541 echo Unable to precompile %2
545 :: Delete original .dll & replace it with the Crossgened .dll
547 ren "%CORE_ROOT%\temp.ni.dll" %2
549 echo Successfully precompiled %2