Skip to content

Commit

Permalink
Fix optprof in servicing branches
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Feb 17, 2021
1 parent 840b795 commit 33cf6db
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions azure-pipelines/variables/InsertPropsValues.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ $BinPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..\bin\Packages\$env:

$dirsToSearch = "$BinPath\NuGet\*.nupkg" |? { Test-Path $_ }
$icv=@()
if ($dirsToSearch) {

# Avoid updating the .props world for an optprof run.
# This avoids analyzer updates that are unrelated and can cause build breaks
# as well as breaks in servicing branches when we insert a PublicRelease=false unstable package version.
if ($dirsToSearch -and !$env:OPTPROF) {
Get-ChildItem -Path $dirsToSearch |% {
if ($_.Name -match "^(.*)\.(\d+\.\d+\.\d+(?:-.*?)?)(?:\.symbols)?\.nupkg$") {
$id = $Matches[1]
$version = $Matches[2]
# Avoid inserting analyzers in an optprof run.
if ($env:OPTPROF -ne 'true' -or $_.Name -notlike '*Analyzers*') {
$icv += "$id=$version"
}
$icv += "$id=$version"
}
}
}
Expand Down

0 comments on commit 33cf6db

Please sign in to comment.