|
1 | 1 | <Project> |
| 2 | + <!-- |
| 3 | + Build/Src uses the repo root CPM file as its baseline, then layers only the |
| 4 | + few build-tool-specific deltas that genuinely differ from application code. |
| 5 | + NuGet auto-imports only the nearest Directory.Packages.props, so parent CPM |
| 6 | + settings must be imported manually. |
| 7 | + --> |
2 | 8 | <PropertyGroup> |
3 | | - <!-- |
4 | | - Build infrastructure projects (FwBuildTasks, NativeBuild) manage their own |
5 | | - package versions independently. They do not contribute assemblies to the |
6 | | - shared Output/ directory, so CPM transitive pinning does not apply here. |
7 | | - FwBuildTasks also requires different versions of test infrastructure packages |
8 | | - (NUnit3TestAdapter 5.2.0, SIL.TestUtilities 12.0.0-*) than the main codebase. |
9 | | - --> |
10 | | - <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> |
| 9 | + <RootDirectoryPackagesProps>$([MSBuild]::GetPathOfFileAbove('Directory.Packages.props', '$(MSBuildThisFileDirectory)..'))</RootDirectoryPackagesProps> |
11 | 10 | </PropertyGroup> |
| 11 | + |
| 12 | + <Import Project="$(RootDirectoryPackagesProps)" Condition="Exists('$(RootDirectoryPackagesProps)')" /> |
| 13 | + |
| 14 | + <Target Name="EnsureRootDirectoryPackagesPropsExists" BeforeTargets="CollectPackageReferences" Condition="'$(RootDirectoryPackagesProps)' == '' Or !Exists('$(RootDirectoryPackagesProps)')"> |
| 15 | + <Error Text="Unable to locate the repo root Directory.Packages.props for Build/Src. Expected to find a parent Directory.Packages.props above '$(MSBuildThisFileDirectory)'. Ensure the root CPM file exists and has not been renamed or omitted from the current source checkout." /> |
| 16 | + </Target> |
| 17 | + |
| 18 | + <!-- Use Update for root-pinned packages and Include for build-only packages absent from the root CPM file. --> |
| 19 | + <ItemGroup Label="Build Tool Package Versions"> |
| 20 | + <PackageVersion Include="Microsoft.Build.Utilities.Core" Version="18.4.0" /> |
| 21 | + <PackageVersion Update="Microsoft.Extensions.DependencyModel" Version="2.1.0" /> |
| 22 | + <PackageVersion Update="NUnit3TestAdapter" Version="5.2.0" /> |
| 23 | + <PackageVersion Include="SIL.BuildTasks" Version="3.2.0" /> |
| 24 | + <PackageVersion Update="SIL.TestUtilities" Version="12.0.1" /> |
| 25 | + </ItemGroup> |
12 | 26 | </Project> |
0 commit comments