forked from dotnet/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-build.ps1
42 lines (34 loc) · 1.14 KB
/
run-build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# 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" }