From f35aad0e18420dac604ab99591e2cdfee0f9c73c Mon Sep 17 00:00:00 2001 From: Stuart Meeks Date: Thu, 20 Aug 2026 12:53:32 +0000 Subject: [PATCH] chore: finish CPM and move shared properties to Directory.Build.props PR C of the NextIteration.Standards adoption sequence, and the last one. Closes 1.2 and 1.3, taking this repo to 27/27 machine-checkable clauses. 2.6 was already closed in PR A, which is what invoking the collector took -- the package was referenced before that but nothing passed --coverage. Directory.Packages.props gains CentralPackageVersionOverrideEnabled=false. Without it MSBuild silently ignores a stray inline Version= and uses the central one, which is the exact drift the file exists to prevent, and it prevents it without ever saying so. Verified rather than assumed: adding Version="0.50.0" to a PackageReference now fails restore with NU1008. The fifteen properties both csprojs restated identically move to Directory.Build.props. Each csproj now carries only what is specific to it. The test project keeps GenerateDocumentationFile=false as an explicit opt-out -- fixture code has no XML docs and TreatWarningsAsErrors would otherwise fail the build over every missing one. EnforceCodeStyleInBuild is deliberately absent. 1.2.1 is blocked. Consumer impact proven, not asserted. Packed both sides at this commit from a clean obj/, per ADOPTING.md -- a reused obj/ makes the two builds embed different git SHAs via SourceLink, moving the MVID and the deterministic PE stamp, and both assemblies then "differ" for reasons that have nothing to do with CPM. Results: .nuspec sha256 identical lib/net8.0/*.dll sha256 identical lib/net10.0/*.dll sha256 identical lib/net8.0, net10.0 *.xml sha256 identical README.md, icon.png sha256 identical [Content_Types].xml sha256 identical *.psmdcp content identical *.psmdcp FILENAME differs -- regenerated per pack _rels/.rels differs only in that filename That is exactly the one difference ADOPTING.md names as acceptable. Release build clean at zero warnings; 64/64 tests pass on net8.0 and net10.0 with coverage collected on both. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 12 +++++ Directory.Build.props | 44 ++++++++++++++++--- Directory.Packages.props | 7 +++ ...xtIteration.SpectreConsole.Settings.csproj | 19 ++------ ...ation.SpectreConsole.Settings.Tests.csproj | 5 ++- 5 files changed, 64 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fca0c89..e2e8631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,18 @@ floor. - Adopted the canonical `.gitignore` and `.editorconfig`. The `.editorconfig` change scopes the private-field naming rule to instance fields — a `const` is a field, so the rule previously demanded `_nonceSize` for `private const int NonceSize`. +- Moved the build properties shared by both projects out of the individual csprojs + and into the root `Directory.Build.props`. Both projects previously restated the + same fifteen properties, which is fifteen chances for one copy to drift silently. + Each csproj now carries only what is specific to it. `Directory.Packages.props` + also gains `CentralPackageVersionOverrideEnabled=false`, so a stray inline + `Version=` on a `PackageReference` is now an `NU1008` restore failure instead of + being silently ignored in favour of the central version. Verified to be a + no-op for consumers: packing at the same commit from a clean `obj/` before and + after produces a byte-identical `.nuspec`, byte-identical `net8.0` and `net10.0` + assemblies and XML docs, and identical `README.md`, icon and package metadata — + the only difference anywhere in the package is the `.psmdcp` filename, which NuGet + regenerates on every pack. ### Added diff --git a/Directory.Build.props b/Directory.Build.props index 08993bb..d216bf1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,40 @@ - - enable - true - Stuart Meeks - Next Iteration - + + + + enable + enable + en + latest + true + true + true + snupkg + portable + true + true + true + MIT + © Stuart Meeks + true + Stuart Meeks + Next Iteration + + diff --git a/Directory.Packages.props b/Directory.Packages.props index 29313ff..a874583 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,6 +1,13 @@ true + + false diff --git a/src/NextIteration.SpectreConsole.Settings/NextIteration.SpectreConsole.Settings.csproj b/src/NextIteration.SpectreConsole.Settings/NextIteration.SpectreConsole.Settings.csproj index fe0e712..f3070e7 100644 --- a/src/NextIteration.SpectreConsole.Settings/NextIteration.SpectreConsole.Settings.csproj +++ b/src/NextIteration.SpectreConsole.Settings/NextIteration.SpectreConsole.Settings.csproj @@ -1,37 +1,26 @@ + net8.0;net10.0 - enable - enable - en - true - latest NextIteration.SpectreConsole.Settings 0.3.0 - Stuart Meeks Strongly-typed, JSON-persisted settings for CLI tools, with automatic or explicit persistence and ready-made Spectre.Console settings commands. true $(MSBuildThisFileDirectory)..\..\artifacts\packages true - MIT README.md https://github.com/StuartMeeks/NextIteration.SpectreConsole.Settings https://github.com/StuartMeeks/NextIteration.SpectreConsole.Settings.git git spectre;cli;settings;configuration;json icon.png - © Stuart Meeks - true - true - true - true - snupkg - portable - true diff --git a/tests/NextIteration.SpectreConsole.Settings.Tests/NextIteration.SpectreConsole.Settings.Tests.csproj b/tests/NextIteration.SpectreConsole.Settings.Tests/NextIteration.SpectreConsole.Settings.Tests.csproj index 62fd542..d3429cd 100644 --- a/tests/NextIteration.SpectreConsole.Settings.Tests/NextIteration.SpectreConsole.Settings.Tests.csproj +++ b/tests/NextIteration.SpectreConsole.Settings.Tests/NextIteration.SpectreConsole.Settings.Tests.csproj @@ -10,10 +10,11 @@ Exe - enable - enable false true + false