Skip to content

Commit 729d1e3

Browse files
authored
ensure that we don't crash due to version conflict on GetPackageProperties. ensure that when processing AdditionalValidationPackages and failing, we don't simply end the script there (Azure#50538)
1 parent daa0d21 commit 729d1e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
1616
# Save-Package-Properties.ps1
1717
$shouldAddDevVersion = Get-Variable -Name 'addDevVersion' -ValueOnly -ErrorAction 'Ignore'
1818
$ServiceProj = Join-Path -Path $EngDir -ChildPath "service.proj"
19-
Write-Host "dotnet msbuild /nologo /t:GetPackageInfo ""$ServiceProj"" /p:ServiceDirectory=$serviceDirectory /p:AddDevVersion=$shouldAddDevVersion -tl:off"
19+
Write-Host "dotnet msbuild /nologo /t:GetPackageInfo ""$ServiceProj"" /p:EnableCentralPackageVersions=False /p:ServiceDirectory=$serviceDirectory /p:AddDevVersion=$shouldAddDevVersion -tl:off"
2020

2121
$msbuildOutput = dotnet msbuild `
2222
/nologo `
2323
/t:GetPackageInfo `
2424
"$ServiceProj" `
25+
/p:EnableCentralPackageVersions=False `
2526
/p:ServiceDirectory=$serviceDirectory `
2627
/p:AddDevVersion=$shouldAddDevVersion `
2728
-tl:off
@@ -128,7 +129,8 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet($LocatedPackages,
128129
Write-Host "Failed calculating dependencies for '$TestDependsOnDependency'. Exit code $LASTEXITCODE."
129130
Write-Host "Dumping erroring build output."
130131
Write-Host (Get-Content -Raw $buildOutputPath)
131-
continue
132+
133+
return @()
132134
}
133135

134136
if (Test-Path $outputFilePath) {

0 commit comments

Comments
 (0)