Imported Upstream version 5.10.0.69

Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-29 19:03:06 +00:00
parent d8f8abd549
commit e2950ec768
6283 changed files with 453847 additions and 91879 deletions

View File

@@ -3,21 +3,14 @@ set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT
:: Default to highest Visual Studio version available
set __VSVersion=vs2015
if defined VS150COMNTOOLS set __VSVersion=vs2017
:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0.."
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__SourceDir=%__ProjectDir%\src"
set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set __MSBCleanBuildArgs=
set __SkipTestBuild=
set __ToolchainMilestone=testing
set "__DotNetCliPath=%__ProjectDir%\Tools\dotnetcli"
:Arg_Loop
@@ -33,18 +26,15 @@ if /i "%1" == "-help" goto Usage
if /i "%1" == "x64" (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86" (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm" (set __BuildArch=arm&&shift&goto Arg_Loop)
if /i "%1" == "wasm" (set __BuildOS=WebAssembly&&set __BuildArch=wasm&&shift&goto Arg_Loop)
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
if /i "%1" == "vs2017" (set __VSVersion=vs2017&shift&goto Arg_Loop)
if /i "%1" == "vs2015" (set __VSVersion=vs2015&shift&goto Arg_Loop)
if /i "%1" == "clean" (set __CleanBuild=1&shift&goto Arg_Loop)
if /i "%1" == "skiptests" (set __SkipTests=1&shift&goto Arg_Loop)
if /i "%1" == "skipvsdev" (set __SkipVsDev=1&shift&goto Arg_Loop)
if /i "%1" == "/milestone" (set __ToolchainMilestone=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "/dotnetclipath" (set __DotNetCliPath=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "/officialbuildid" (set "__ExtraMsBuildParams=/p:OfficialBuildId=%2"&shift&shift&goto Arg_Loop)
@@ -54,15 +44,11 @@ exit /b 1
:ArgsDone
:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__BinDir=%__RootBinDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__ObjDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\Native\%__BuildOS%.%__BuildArch%.%__BuildType%\"
set "__RelativeProductBinDir=bin\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__NativeBuildLog=%__LogsDir%\Native_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
set "__BuildLog=%__LogsDir%\msbuild_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
set "__ReproProjectDir=%__ProjectDir%\src\ILCompiler\repro"
set "__ReproProjectBinDir=%__BinDir%\repro"
set "__ReproProjectObjDir=%__ObjDir%\repro"
:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
@@ -73,9 +59,6 @@ if not defined __CleanBuild goto MakeDirs
echo Doing a clean build
echo.
:: MSBuild projects would need a rebuild
set __MSBCleanBuildArgs=/t:rebuild /p:CleanedTheBuild=1
:: Cleanup the previous output for the selected configuration
if exist "%__BinDir%" rd /s /q "%__BinDir%"
if exist "%__ObjDir%" rd /s /q "%__ObjDir%"
@@ -89,11 +72,25 @@ if not exist "%__ObjDir%" md "%__ObjDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
if not exist "%__LogsDir%" md "%__LogsDir%"
:CheckPrereqs
:: Check prerequisites
echo Checking pre-requisites...
echo.
if "%__BuildArch%"=="wasm" (
goto :CheckPrereqsEmscripten
) else (
goto :CheckPrereqsVs
)
:CheckPrereqsEmscripten
if not defined EMSCRIPTEN (
echo Emscripten is a prerequisite to build for WebAssembly.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-WebAssembly.md
exit /b 1
)
goto CheckPrereqsVs
:CheckPrereqsVs
:: Validate that PowerShell is accessibile.
for %%X in (powershell.exe) do (set __PSDir=%%~$PATH:X)
if defined __PSDir goto EvaluatePS
@@ -105,45 +102,58 @@ exit /b 1
:: Eval the output from probe-win1.ps1
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\Native\probe-win.ps1"""') do %%a
:: Default to highest Visual Studio version available
::
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
:: is no longer set as a global environment variable and is instead only set if the user
:: has launched the VS2017 Developer Command Prompt.
::
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
:: is already configured to use that toolset. Otherwise, we will fallback to using the latest
:: VS2017 toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.
set __VSProductVersion=
if /i "%__VSVersion%" == "vs2015" set __VSProductVersion=140
if /i "%__VSVersion%" == "vs2017" set __VSProductVersion=150
if defined VisualStudioVersion goto :RunVCVars
:: Check presence of VS
if defined VS%__VSProductVersion%COMNTOOLS goto CheckVSExistence
echo Visual Studio 2015 or 2017 (Community is free) is a pre-requisite to build this repository.
echo If you're using Visual Studio 2017, make sure to run build.cmd from the "Developer Command Prompt
echo for VS 2017" (find it in the Start menu).
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %_VSWHERE% (
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
)
if not exist "%_VSCOMNTOOLS%" goto :MissingVersion
call "%_VSCOMNTOOLS%\VsDevCmd.bat"
:RunVCVars
if "%VisualStudioVersion%"=="15.0" (
goto :VS2017
)
:MissingVersion
:: Can't find VS 2017
echo Visual Studio 2017 is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1
:CheckVSExistence
:: Does VS VS 2015 really exist?
if exist "!VS%__VSProductVersion%COMNTOOLS!\..\IDE\devenv.exe" goto CheckMSBuild
echo Visual Studio not installed in !VS%__VSProductVersion%COMNTOOLS!.
:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __VSProductVersion=150
if not exist "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\Auxiliary\Build\vcvarsall.bat" goto :MissingVisualC
goto :CheckMSBuild
:MissingVisualC
echo Could not find Visual C++ under !VS%__VSProductVersion%COMNTOOLS!. Visual C++ is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1
:CheckMSBuild
:: Note: We've disabled node reuse because it causes file locking issues.
:: The issue is that we extend the build with our own targets which
:: means that that rebuilding cannot successfully delete the task
:: assembly.
if /i "%__VSVersion%" == "vs2017" (
rem The MSBuild that is installed in the shared location is not compatible
rem with VS2017 C++ projects. I must use the MSBuild located in
rem C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
rem which is compatible. However, I don't know a good way to specify this
rem path in a way that isn't specific to my system, so I am relying on the
rem system PATH to locate this tool.
set _msbuildexe=msbuild
) else (
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist !_msbuildexe! (set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe")
if not exist !_msbuildexe! (echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md for build instructions. && exit /b 1)
)
rem The MSBuild that is installed in the shared location is not compatible
rem with VS2017 C++ projects. I must use the MSBuild located in
rem C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
set _msbuildexe="%VSINSTALLDIR%\MSBuild\15.0\Bin\MSBuild.exe"
if not exist !_msbuildexe! (echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md for build instructions. && exit /b 1)
rem Explicitly set Platform causes conflicts in managed project files. Clear it to allow building from VS x64 Native Tools Command Prompt
set Platform=
@@ -152,10 +162,10 @@ set Platform=
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)
rem Tell nuget to always use repo-local nuget package cache. The "dotnet restore" invocations use the --packages
rem argument, but there are a few commands in publish and tests that do not.
set "NUGET_PACKAGES=%__PackagesDir%"
set __NugetRuntimeId=win7-x64
if /i "%__BuildArch%" == "x86" (set __NugetRuntimeId=win7-x86)
:Done
set BUILDVARS_DONE=1
exit /b 0
@@ -169,9 +179,8 @@ echo.
echo All arguments are optional. The options are:
echo.
echo./? -? /h -h /help -help: view this message.
echo Build architecture: one of x64, x86, arm ^(default: x64^).
echo Build architecture: one of x64, x86, arm, wasm ^(default: x64^).
echo Build type: one of Debug, Checked, Release ^(default: Debug^).
echo Visual Studio version: vs2015, vs2017 ^(defaults to highest detected^).
echo clean: force a clean build ^(default is to perform an incremental build^).
echo skiptests: skip building tests ^(default: tests are built^).
exit /b 1
exit /b 1