Skip to content

Commit c6ef151

Browse files
committed
Added target to pin sibling Biohazrd dependencies to specific versions.
1 parent a40db9f commit c6ef151

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tooling/Common.csproj.targets

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,20 @@
4040
<Target Name="EnsurePackageHasSpecificDescriptionBeforeBuild" BeforeTargets="Build" Condition="'$(IsPackable)' == 'true' and '$(PackageDidNotSpecifyCustomDescription)' == 'true'and '$(AssemblyName)' != 'Biohazrd.AllInOne'">
4141
<Warning Text="$(AssemblyName) does not have a PackageDescription!" />
4242
</Target>
43+
44+
<!--
45+
This ensures Biohazrd packages use exact version matching for sibling Biohazrd dependencies since we do not support mixing and matching
46+
This target is taken from https://github.com/NuGet/Home/issues/5556#issuecomment-585482714
47+
-->
48+
<Target Name="UseExactProjectReferenvePackageVersions" AfterTargets="_GetProjectReferenceVersions">
49+
<ItemGroup>
50+
<_ProjectReferencesWithExactVersions Include="@(_ProjectReferencesWithVersions)">
51+
<ProjectVersion>[%(_ProjectReferencesWithVersions.ProjectVersion)]</ProjectVersion>
52+
</_ProjectReferencesWithExactVersions>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<_ProjectReferencesWithVersions Remove="@(_ProjectReferencesWithVersions)" />
56+
<_ProjectReferencesWithVersions Include="@(_ProjectReferencesWithExactVersions)" />
57+
</ItemGroup>
58+
</Target>
4359
</Project>

0 commit comments

Comments
 (0)