1 [CmdletBinding
(PositionalBinding
=$false)]
3 [string
] $configuration = 'Debug',
5 [string
] $verbosity = 'minimal',
6 [string
] $msbuildEngine = $null,
8 [switch] $prepareMachine,
10 [Parameter
(ValueFromRemainingArguments
=$true)][String
[]]$properties
17 . $PSScriptRoot\tools
.ps1
19 function Print-Usage
() {
20 Write-Host "Common settings:"
21 Write-Host " -task <value> Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)"
22 Write-Host " -restore Restore dependencies"
23 Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
24 Write-Host " -help Print help and exit"
27 Write-Host "Advanced settings:"
28 Write-Host " -prepareMachine Prepare machine for CI run"
29 Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
31 Write-Host "Command line arguments not listed above are passed thru to msbuild."
34 function Build
([string
]$target) {
35 $logSuffix = if ($target -eq
'Execute') { '' } else { ".$target" }
36 $log = Join-Path $LogDir "$task$logSuffix.binlog"
37 $outputPath = Join-Path $ToolsetDir "$task\\"
39 MSBuild
$taskProject `
42 /p
:Configuration
=$configuration `
43 /p
:RepoRoot
=$RepoRoot `
44 /p
:BaseIntermediateOutputPath
=$outputPath `
49 if ($help -or
(($null -ne
$properties) -and
($properties.Contains
('/help') -or
$properties.Contains
('/?')))) {
55 Write-PipelineTelemetryError
-Category
'Build' -Message
"Missing required parameter '-task <value>'" -ForegroundColor Red
60 $taskProject = GetSdkTaskProject
$task
61 if (!(Test-Path $taskProject)) {
62 Write-PipelineTelemetryError
-Category
'Build' -Message
"Unknown task: $task" -ForegroundColor Red
73 Write-Host $_.ScriptStackTrace
74 Write-PipelineTelemetryError
-Category
'Build' -Message
$_