Merge branch 'master' of /Users/livarcocc/Documents/git/cli into merge_master_cli
* 'master' of /Users/livarcocc/Documents/git/cli: (1063 commits) Updating signing project to use new intermediate directory (int). Update runtimeconfig.json doc for 2.1 (#9382) Shortening the path to the intermediate folder by renaming it to int. fix typo (#9364) Updating asp.net to 2.2.0 as well. Updating the build and tests to work with the 2.2.0 runtime. Simplified combining dictionaries in Telemetry Fixing 'Channel' and 'BranchName': "release/2.1.4xx" to "master" (#9362) Fix extraction of folders (#9335) Update Sha256Hasher.cs Fix relative path tool path (#9330) Insert updated SDK from 2.1.4xx branch MSBuild 15.8.60 Fix crash when user home directory cannot be determined. Make `CliFolderPathCalculator` a static class. Don't add the ReleaseSuffix to the branding on the CLI when DropSuffix is set to true. Add retry when Directory.Move (#9313) Override new SdkResult public properties Add reference to Microsoft.Build.NuGetSdkResolver Disable crossgen for MSBuild inline-task refs ...
This commit is contained in:
commit
e2b679c4bb
210 changed files with 4436 additions and 1701 deletions
|
@ -16,17 +16,31 @@ param(
|
|||
|
||||
if($Help)
|
||||
{
|
||||
Write-Output "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-Help]"
|
||||
Write-Output "Usage: .\run-build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-NoBuild] [-Help]"
|
||||
Write-Output ""
|
||||
Write-Output "Options:"
|
||||
Write-Output " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
|
||||
Write-Output " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
|
||||
Write-Output " -Architecture <ARCHITECTURE> Build the specified architecture (x64, x86, arm, or arm64 , default: x64)"
|
||||
Write-Output " -NoPackage Skip packaging targets"
|
||||
Write-Output " -NoBuild Skip building the product"
|
||||
Write-Output " -Help Display this help message"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target
|
||||
# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'.
|
||||
if ($ExtraParameters)
|
||||
{
|
||||
$ExtraParametersNoTargets = $ExtraParameters.GetRange(0,$ExtraParameters.Count)
|
||||
foreach ($param in $ExtraParameters)
|
||||
{
|
||||
if(($param.StartsWith("/t:", [StringComparison]::OrdinalIgnoreCase)) -or ($param.StartsWith("/target:", [StringComparison]::OrdinalIgnoreCase)))
|
||||
{
|
||||
$ExtraParametersNoTargets.Remove("$param") | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$env:CONFIGURATION = $Configuration;
|
||||
$RepoRoot = "$PSScriptRoot"
|
||||
if(!$env:NUGET_PACKAGES){
|
||||
|
@ -53,33 +67,33 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR))
|
|||
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Disable first run since we want to control all package sources
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
# Don't resolve shared frameworks from user or global locations
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP=0
|
||||
|
||||
# Turn off MSBuild Node re-use
|
||||
$env:MSBUILDDISABLENODEREUSE=1
|
||||
|
||||
# Enable vs test console logging
|
||||
$env:VSTEST_BUILD_TRACE=1
|
||||
$env:VSTEST_TRACE_BUILD=1
|
||||
|
||||
# install a stage0
|
||||
if (!$env:DOTNET_TOOL_DIR)
|
||||
{
|
||||
$dotnetInstallPath = Join-Path $env:DOTNET_INSTALL_DIR "dotnet-install.ps1"
|
||||
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$dotnetInstallPath"
|
||||
$dotnetInstallPath = Join-Path $env:DOTNET_INSTALL_DIR "dotnet-install.ps1"
|
||||
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$dotnetInstallPath"
|
||||
|
||||
Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||
Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
|
||||
exit $LastExitCode
|
||||
}
|
||||
$InstallArchitecture = $Architecture
|
||||
if($Architecture.StartsWith("arm", [StringComparison]::OrdinalIgnoreCase))
|
||||
{
|
||||
$InstallArchitecture = "x64"
|
||||
}
|
||||
else
|
||||
|
||||
Write-Output "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture"""
|
||||
Invoke-Expression "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture"""
|
||||
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
Copy-Item -Recurse -Force $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR
|
||||
}
|
||||
|
@ -94,7 +108,7 @@ if ($NoBuild)
|
|||
}
|
||||
else
|
||||
{
|
||||
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParametersNoTargets
|
||||
dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue