Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit345707c

Browse files
authored
Add ability to capture MSBuild Binary logs when restore fails (#24128)
* Capture binary logs* Update .pipelines/PowerShell-Coordinated_Packages-Official.yml
1 parent8cc7f4c commit345707c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

‎.pipelines/PowerShell-Coordinated_Packages-Official.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ parameters:
2222
displayName:Enable Windows Stage
2323
type:boolean
2424
default:true
25+
-name:ENABLE_MSBUILD_BINLOGS
26+
displayName:Enable MSBuild Binary Logs
27+
type:boolean
28+
default:false
2529

2630
resources:
2731
repositories:
@@ -68,6 +72,8 @@ variables:
6872
value:${{ parameters.SKIP_SIGNING }}
6973
-group:'AzDevOpsArtifacts'
7074
-group:'mscodehub-feed-read-akv'
75+
-name:ENABLE_MSBUILD_BINLOGS
76+
value:${{ parameters.ENABLE_MSBUILD_BINLOGS }}
7177

7278
extends:
7379
template:v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates

‎build.psm1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,10 @@ function Restore-PSPackage
853853
$RestoreArguments+="--interactive"
854854
}
855855

856+
if ($env:ENABLE_MSBUILD_BINLOGS) {
857+
$RestoreArguments+='-bl'
858+
}
859+
856860
$ProjectDirs|ForEach-Object {
857861
$project=$_
858862
Write-Log-message"Run dotnet restore$project$RestoreArguments"
@@ -870,6 +874,23 @@ function Restore-PSPackage
870874
$retryCount++
871875
if($retryCount-ge$maxTries)
872876
{
877+
if ($env:ENABLE_MSBUILD_BINLOGS) {
878+
if (Test-Path ./msbuild.binlog ) {
879+
if (!(Test-Path$env:OB_OUTPUTDIRECTORY-PathType Container)) {
880+
$null=New-Item-path$env:OB_OUTPUTDIRECTORY-ItemType Directory-Force-Verbose
881+
}
882+
883+
$projectName=Split-Path-Leaf-Path$project
884+
$binlogFileName="${projectName}.msbuild.binlog"
885+
if ($IsMacOS) {
886+
$resolvedPath= (Resolve-Path-Path ./msbuild.binlog).ProviderPath
887+
Write-Host"##vso[artifact.upload containerfolder=$binLogFileName;artifactname=$binLogFileName]$resolvedPath"
888+
}else {
889+
Copy-Item-Path ./msbuild.binlog-Destination"$env:OB_OUTPUTDIRECTORY/${projectName}.msbuild.binlog"-Verbose
890+
}
891+
}
892+
}
893+
873894
throw
874895
}
875896
continue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp