Skip to content

Commit

Permalink
Use version range on project references (#14719)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldbarendse authored Dec 1, 2023
1 parent b596900 commit 50baed1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>

<!-- Use version range on project references (to limit on major version in generated packages) -->
<Target Name="_GetProjectReferenceVersionRanges" AfterTargets="_GetProjectReferenceVersions">
<ItemGroup>
<_ProjectReferencesWithVersions Condition="'%(ProjectVersion)' != ''">
<ProjectVersion>[%(ProjectVersion), $([MSBuild]::Add($([System.Text.RegularExpressions.Regex]::Match('%(ProjectVersion)', '^\d+').Value), 1)))</ProjectVersion>
</_ProjectReferencesWithVersions>
</ItemGroup>
</Target>
</Project>

0 comments on commit 50baed1

Please sign in to comment.