dotnet-installer/run-build.ps1
Michael Yanni 34c7829222 Merge branch 'feature/installer-merge-update-main' into feature/installer-merge-update
# Conflicts:
#	eng/Version.Details.xml
#	eng/Versions.props
#	global.json
#	src/redist/redist.csproj
#	src/redist/targets/BundledDotnetTools.targets
#	src/redist/targets/BundledTemplates.targets
#	src/redist/targets/Crossgen.targets
#	src/redist/targets/GenerateArchives.targets
#	src/redist/targets/GenerateLayout.targets
#	src/redist/targets/GeneratePKG.targets
#	test/SdkTests/SdkTests.csproj
2024-02-27 13:09:06 -08:00

42 lines
1.1 KiB
PowerShell

#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
[CmdletBinding(PositionalBinding=$false)]
param(
[string]$Configuration="Debug",
[string]$Architecture="x64",
[switch]$Sign=$false,
[switch]$PgoInstrument,
[bool]$WarnAsError=$true,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$ExtraParameters
)
$RepoRoot = "$PSScriptRoot"
$Parameters = "/p:Architecture=$Architecture"
$Parameters = "$Parameters -configuration $Configuration"
if ($PgoInstrument) {
$Parameters = "$Parameters /p:PgoInstrument=true"
}
if ($Sign) {
$Parameters = "$Parameters -sign /p:SignCoreSdk=true"
}
$Parameters = "$Parameters -WarnAsError `$$WarnAsError"
try {
$ExpressionToInvoke = "$RepoRoot\eng\common\build.ps1 -restore -build -nativeToolsOnMachine $Parameters $ExtraParameters"
Write-Host "Invoking expression: $ExpressionToInvoke"
Invoke-Expression $ExpressionToInvoke
}
catch {
Write-Error $_
Write-Error $_.ScriptStackTrace
throw "Failed to build"
}
if($LASTEXITCODE -ne 0) { throw "Failed to build" }