@@ -34,6 +34,7 @@ param (
3434 [switch ]$bootstrap ,
3535 [string ]$bootstrapConfiguration = " Release" ,
3636 [switch ][Alias (' bl' )]$binaryLog ,
37+ [string ]$binaryLogName = " " ,
3738 [switch ]$buildServerLog ,
3839 [switch ]$ci ,
3940 [switch ]$collectDumps ,
@@ -79,6 +80,7 @@ function Print-Usage() {
7980 Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
8081 Write-Host " -deployExtensions Deploy built vsixes (short: -d)"
8182 Write-Host " -binaryLog Create MSBuild binary log (short: -bl)"
83+ Write-Host " -binaryLogName Name of the binary log (default Build.binlog)"
8284 Write-Host " -buildServerLog Create Roslyn build server log"
8385 Write-Host " "
8486 Write-Host " Actions:"
@@ -166,13 +168,21 @@ function Process-Arguments() {
166168 $script :applyOptimizationData = $false
167169 }
168170
171+ if ($binaryLogName -ne " " ) {
172+ $script :binaryLog = $true
173+ }
174+
169175 if ($ci ) {
170176 $script :binaryLog = $true
171177 if ($bootstrap ) {
172178 $script :buildServerLog = $true
173179 }
174180 }
175181
182+ if ($binaryLog -and ($binaryLogName -eq " " )) {
183+ $binaryLogName = " Build.binlog"
184+ }
185+
176186 $anyUnit = $testDesktop -or $testCoreClr
177187 if ($anyUnit -and $testVsi ) {
178188 Write-Host " Cannot combine unit and VSI testing"
@@ -213,7 +223,16 @@ function BuildSolution() {
213223
214224 Write-Host " $ ( $solution ) :"
215225
216- $bl = if ($binaryLog ) { " /bl:" + (Join-Path $LogDir " Build.binlog" ) } else { " " }
226+ $bl = " "
227+ if (binaryLog) {
228+ $binaryLogPath = Join-Path $LogDir $binaryLogName
229+ $bl = " /bl:" + $binaryLogPath
230+ if ($ci -and Test-Path $binaryLogPath ) {
231+ Write-LogIssue - Type " warning" - Message " Overwriting binary log file $ ( $binaryLogPath ) "
232+ }
233+
234+ }
235+ $bl = if ($binaryLog ) { " /bl:" + (Join-Path $LogDir $binaryLogName ) } else { " " }
217236
218237 if ($buildServerLog ) {
219238 ${env: ROSLYNCOMMANDLINELOGFILE} = Join-Path $LogDir " Build.Server.log"
@@ -734,7 +753,7 @@ try {
734753 catch
735754 {
736755 if ($ci ) {
737- echo " ##vso[task.logissue type= error] (NETCORE_ENGINEERING_TELEMETRY=Build) Build failed"
756+ Write-LogIssue - Type " error" - Message " (NETCORE_ENGINEERING_TELEMETRY=Build) Build failed"
738757 }
739758 throw $_
740759 }
@@ -752,7 +771,7 @@ try {
752771 catch
753772 {
754773 if ($ci ) {
755- echo " ##vso[task.logissue type= error] (NETCORE_ENGINEERING_TELEMETRY=Test ) Tests failed"
774+ Write-LogIssue - Type " error" - Message " (NETCORE_ENGINEERING_TELEMETRY=Build ) Tests failed"
756775 }
757776 throw $_
758777 }
0 commit comments