Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit aa26688

Browse files
dotnet-maestro[bot]wtgodbe
authored andcommitted
Update dependencies from https://github.com/dotnet/arcade build 20190530.2 (#24882)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19280.2 - Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19280.2 - Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19280.2 - Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19280.2
1 parent 0d21b57 commit aa26688

File tree

7 files changed

+243
-40
lines changed

7 files changed

+243
-40
lines changed

eng/Version.Details.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19279.5">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19280.2">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
8+
<Sha>7c50d548001a83a18449ad4dda370122ede5fbf6</Sha>
99
</Dependency>
10-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19279.5">
10+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19280.2">
1111
<Uri>https://github.com/dotnet/arcade</Uri>
12-
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
12+
<Sha>7c50d548001a83a18449ad4dda370122ede5fbf6</Sha>
1313
</Dependency>
14-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.19279.5">
14+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.19280.2">
1515
<Uri>https://github.com/dotnet/arcade</Uri>
16-
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
16+
<Sha>7c50d548001a83a18449ad4dda370122ede5fbf6</Sha>
1717
</Dependency>
18-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19279.5">
18+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19280.2">
1919
<Uri>https://github.com/dotnet/arcade</Uri>
20-
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
20+
<Sha>7c50d548001a83a18449ad4dda370122ede5fbf6</Sha>
2121
</Dependency>
2222
<Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview6.19279.8">
2323
<Uri>https://github.com/dotnet/corefx</Uri>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<UsingToolXliff>false</UsingToolXliff>
1515
<!-- Package versions -->
1616
<!-- arcade -->
17-
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.19279.5</MicrosoftDotNetBuildTasksFeedVersion>
18-
<MicrosoftDotNetBuildTasksPackagingVersion>1.0.0-beta.19279.5</MicrosoftDotNetBuildTasksPackagingVersion>
17+
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.19280.2</MicrosoftDotNetBuildTasksFeedVersion>
18+
<MicrosoftDotNetBuildTasksPackagingVersion>1.0.0-beta.19280.2</MicrosoftDotNetBuildTasksPackagingVersion>
1919
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.19278.1</MicrosoftDotNetXUnitConsoleRunnerVersion>
2020
<!-- corefx -->
2121
<MicrosoftPrivateCoreFxNETCoreAppVersion>4.6.0-preview6.19279.8</MicrosoftPrivateCoreFxNETCoreAppVersion>
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1
2+
3+
# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
4+
5+
$script:loggingCommandPrefix = '##vso['
6+
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
7+
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
8+
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
9+
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
10+
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
11+
)
12+
# TODO: BUG: Escape % ???
13+
# TODO: Add test to verify don't need to escape "=".
14+
15+
<########################################
16+
# Private functions.
17+
########################################>
18+
function Format-LoggingCommandData {
19+
[CmdletBinding()]
20+
param([string]$Value, [switch]$Reverse)
21+
22+
if (!$Value) {
23+
return ''
24+
}
25+
26+
if (!$Reverse) {
27+
foreach ($mapping in $script:loggingCommandEscapeMappings) {
28+
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
29+
}
30+
} else {
31+
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
32+
$mapping = $script:loggingCommandEscapeMappings[$i]
33+
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
34+
}
35+
}
36+
37+
return $Value
38+
}
39+
40+
function Format-LoggingCommand {
41+
[CmdletBinding()]
42+
param(
43+
[Parameter(Mandatory = $true)]
44+
[string]$Area,
45+
[Parameter(Mandatory = $true)]
46+
[string]$Event,
47+
[string]$Data,
48+
[hashtable]$Properties)
49+
50+
# Append the preamble.
51+
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
52+
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
53+
54+
# Append the properties.
55+
if ($Properties) {
56+
$first = $true
57+
foreach ($key in $Properties.Keys) {
58+
[string]$value = Format-LoggingCommandData $Properties[$key]
59+
if ($value) {
60+
if ($first) {
61+
$null = $sb.Append(' ')
62+
$first = $false
63+
} else {
64+
$null = $sb.Append(';')
65+
}
66+
67+
$null = $sb.Append("$key=$value")
68+
}
69+
}
70+
}
71+
72+
# Append the tail and output the value.
73+
$Data = Format-LoggingCommandData $Data
74+
$sb.Append(']').Append($Data).ToString()
75+
}
76+
77+
function Write-LoggingCommand {
78+
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
79+
param(
80+
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
81+
[string]$Area,
82+
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
83+
[string]$Event,
84+
[Parameter(ParameterSetName = 'Parameters')]
85+
[string]$Data,
86+
[Parameter(ParameterSetName = 'Parameters')]
87+
[hashtable]$Properties,
88+
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
89+
$Command,
90+
[switch]$AsOutput)
91+
92+
if ($PSCmdlet.ParameterSetName -eq 'Object') {
93+
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
94+
return
95+
}
96+
97+
$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
98+
if ($AsOutput) {
99+
$command
100+
} else {
101+
Write-Host $command
102+
}
103+
}
104+
105+
function Write-LogIssue {
106+
[CmdletBinding()]
107+
param(
108+
[ValidateSet('warning', 'error')]
109+
[Parameter(Mandatory = $true)]
110+
[string]$Type,
111+
[string]$Message,
112+
[string]$ErrCode,
113+
[string]$SourcePath,
114+
[string]$LineNumber,
115+
[string]$ColumnNumber,
116+
[switch]$AsOutput)
117+
118+
$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
119+
'type' = $Type
120+
'code' = $ErrCode
121+
'sourcepath' = $SourcePath
122+
'linenumber' = $LineNumber
123+
'columnnumber' = $ColumnNumber
124+
}
125+
if ($AsOutput) {
126+
return $command
127+
}
128+
129+
if ($Type -eq 'error') {
130+
$foregroundColor = $host.PrivateData.ErrorForegroundColor
131+
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
132+
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
133+
$foregroundColor = [System.ConsoleColor]::Red
134+
$backgroundColor = [System.ConsoleColor]::Black
135+
}
136+
} else {
137+
$foregroundColor = $host.PrivateData.WarningForegroundColor
138+
$backgroundColor = $host.PrivateData.WarningBackgroundColor
139+
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
140+
$foregroundColor = [System.ConsoleColor]::Yellow
141+
$backgroundColor = [System.ConsoleColor]::Black
142+
}
143+
}
144+
145+
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
146+
}

eng/common/build.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ try {
133133
Build
134134
}
135135
catch {
136-
Write-Host $_
137-
Write-Host $_.Exception
138136
Write-Host $_.ScriptStackTrace
137+
Write-PipelineTaskError -Message $_
139138
ExitWithExitCode 1
140139
}
141140

eng/common/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ if [[ -n "${useInstalledDotNetCli:-}" ]]; then
209209
use_installed_dotnet_cli="$useInstalledDotNetCli"
210210
fi
211211

212-
# Workaround for https://github.com/dotnet/arcade/issues/2673
213-
# if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then
214-
# InitializeNativeTools
215-
# fi
212+
if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then
213+
InitializeNativeTools
214+
fi
216215

217216
Build

eng/common/tools.ps1

Lines changed: 81 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,68 @@ function Exec-Process([string]$command, [string]$commandArgs) {
9292
}
9393
}
9494

95+
function Write-PipelineTaskError {
96+
[CmdletBinding()]
97+
param(
98+
[Parameter(Mandatory = $true)]
99+
[string]$Message,
100+
[Parameter(Mandatory = $false)]
101+
[string]$Type = 'error',
102+
[string]$ErrCode,
103+
[string]$SourcePath,
104+
[string]$LineNumber,
105+
[string]$ColumnNumber,
106+
[switch]$AsOutput)
107+
108+
if(!$ci) {
109+
if($Type -eq 'error') {
110+
Write-Error $Message
111+
return
112+
}
113+
elseif ($Type -eq 'warning') {
114+
Write-Warning $Message
115+
return
116+
}
117+
}
118+
119+
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
120+
Write-Host $Message
121+
return
122+
}
123+
if(-not $PSBoundParameters.ContainsKey('Type')) {
124+
$PSBoundParameters.Add('Type', 'error')
125+
}
126+
Write-LogIssue @PSBoundParameters
127+
}
128+
129+
function Write-PipelineSetVariable {
130+
[CmdletBinding()]
131+
param(
132+
[Parameter(Mandatory = $true)]
133+
[string]$Name,
134+
[string]$Value,
135+
[switch]$Secret,
136+
[switch]$AsOutput)
137+
138+
if($ci) {
139+
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
140+
'variable' = $Name
141+
'issecret' = $Secret
142+
} -AsOutput:$AsOutput
143+
}
144+
}
145+
146+
function Write-PipelinePrependPath {
147+
[CmdletBinding()]
148+
param(
149+
[Parameter(Mandatory=$true)]
150+
[string]$Path,
151+
[switch]$AsOutput)
152+
if($ci) {
153+
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
154+
}
155+
}
156+
95157
function InitializeDotNetCli([bool]$install) {
96158
if (Test-Path variable:global:_DotNetInstallDir) {
97159
return $global:_DotNetInstallDir
@@ -134,7 +196,7 @@ function InitializeDotNetCli([bool]$install) {
134196
if ($install) {
135197
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
136198
} else {
137-
Write-Host "Unable to find dotnet with SDK version '$dotnetSdkVersion'" -ForegroundColor Red
199+
Write-PipelineTaskError "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
138200
ExitWithExitCode 1
139201
}
140202
}
@@ -147,12 +209,10 @@ function InitializeDotNetCli([bool]$install) {
147209
# It also ensures that VS msbuild will use the downloaded sdk targets.
148210
$env:PATH = "$dotnetRoot;$env:PATH"
149211

150-
if ($ci) {
151-
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
152-
Write-Host "##vso[task.prependpath]$dotnetRoot"
153-
Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
154-
Write-Host "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
155-
}
212+
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
213+
Write-PipelinePrependPath -Path $dotnetRoot
214+
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
215+
Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1'
156216

157217
return $global:_DotNetInstallDir = $dotnetRoot
158218
}
@@ -184,7 +244,7 @@ function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $archit
184244

185245
& $installScript @installParameters
186246
if ($lastExitCode -ne 0) {
187-
Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red
247+
Write-PipelineTaskError -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
188248
ExitWithExitCode $lastExitCode
189249
}
190250
}
@@ -358,7 +418,7 @@ function InitializeBuildTool() {
358418

359419
if ($msbuildEngine -eq "dotnet") {
360420
if (!$dotnetRoot) {
361-
Write-Host "/global.json must specify 'tools.dotnet'." -ForegroundColor Red
421+
Write-PipelineTaskError "/global.json must specify 'tools.dotnet'."
362422
ExitWithExitCode 1
363423
}
364424

@@ -367,13 +427,13 @@ function InitializeBuildTool() {
367427
try {
368428
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
369429
} catch {
370-
Write-Host $_ -ForegroundColor Red
430+
Write-PipelineTaskError $_
371431
ExitWithExitCode 1
372432
}
373433

374434
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
375435
} else {
376-
Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red
436+
Write-PipelineTaskError "Unexpected value of -msbuildEngine: '$msbuildEngine'."
377437
ExitWithExitCode 1
378438
}
379439

@@ -390,7 +450,7 @@ function GetDefaultMSBuildEngine() {
390450
return "dotnet"
391451
}
392452

393-
Write-Host "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." -ForegroundColor Red
453+
Write-PipelineTaskError "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
394454
ExitWithExitCode 1
395455
}
396456

@@ -441,7 +501,7 @@ function InitializeToolset() {
441501
}
442502

443503
if (-not $restore) {
444-
Write-Host "Toolset version $toolsetVersion has not been restored." -ForegroundColor Red
504+
Write-PipelineTaskError "Toolset version $toolsetVersion has not been restored."
445505
ExitWithExitCode 1
446506
}
447507

@@ -526,7 +586,7 @@ function MSBuild-Core() {
526586
$exitCode = Exec-Process $buildTool.Path $cmdArgs
527587

528588
if ($exitCode -ne 0) {
529-
Write-Host "Build failed." -ForegroundColor Red
589+
Write-PipelineTaskError "Build failed."
530590

531591
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
532592
if ($buildLog -ne $null) {
@@ -554,6 +614,8 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
554614
return $null
555615
}
556616

617+
. $PSScriptRoot\LoggingCommandFunctions.ps1
618+
557619
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
558620
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
559621
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
@@ -569,11 +631,8 @@ Create-Directory $ToolsetDir
569631
Create-Directory $TempDir
570632
Create-Directory $LogDir
571633

572-
if ($ci) {
573-
Write-Host "##vso[task.setvariable variable=Artifacts]$ArtifactsDir"
574-
Write-Host "##vso[task.setvariable variable=Artifacts.Toolset]$ToolsetDir"
575-
Write-Host "##vso[task.setvariable variable=Artifacts.Log]$LogDir"
576-
577-
$env:TEMP = $TempDir
578-
$env:TMP = $TempDir
579-
}
634+
Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir
635+
Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir
636+
Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
637+
Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
638+
Write-PipelineSetVariable -Name 'TMP' -Value $TempDir

0 commit comments

Comments
 (0)