Skip to content

Commit

Permalink
Reject multiple versions of same package (#15367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Winniexu01 authored Jan 22, 2025
1 parent d728c2e commit 2ac4034
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@
<Output TaskParameter="Filtered" ItemName="IntermediatePackageFile" />
</RemoveDuplicates>

<ItemGroup>
<IntermediateFileWithoutVersion Include="$([System.Text.RegularExpressions.Regex]::Replace('%(IntermediatePackageFile.Identity)','\.(\d+\.){2}\d+(-\w+)?(\.(\d+\.){1}\d+)?',''))" />
<NotSupportIntermediateFile Include="@(IntermediateFileWithoutVersion)"
Condition="'%(IntermediateFileWithoutVersion.FileName) @(IntermediateFileWithoutVersion->Count())' != '%(IntermediateFileWithoutVersion.FileName) 1'" />
</ItemGroup>

<Error Condition="'@(NotSupportIntermediateFile)' != ''"
Text="There are multiple versions of these packages, please identify which version will go into the intermediate:%0a@(NotSupportIntermediateFile, '%0a')" />

<ItemGroup>
<IntermediateNonShippingNupkgFile Include="@(IntermediatePackageFile)" Condition="$([System.Text.RegularExpressions.Regex]::Match(%(Identity),'[\\\\/]NonShipping[\\\\/]').Success)"/>
<SupplementalIntermediateNupkgCategory Include="%(IntermediatePackageFile.Category)" />
Expand Down

0 comments on commit 2ac4034

Please sign in to comment.