From 5af80eb8087407ec263d086cc0aedd826e519fc3 Mon Sep 17 00:00:00 2001 From: Stuart Meeks Date: Thu, 20 Aug 2026 16:43:13 +0000 Subject: [PATCH] chore: finish CPM, centralise build properties, restore SourceLink PR C of the adoption sequence in ADOPTING.md. Closes the last four file clauses: 1.2, 1.3, 1.7 and 1.8. - 1.3: Directory.Packages.props gains CentralPackageVersionOverrideEnabled =false. This repo already had CPM with versionless PackageReferences, so this is the one-line completion rather than a migration. Without it MSBuild silently ignores a stray inline Version= and uses the central one, which is the exact drift the file exists to prevent. - 1.2: root Directory.Build.props replaced with the canonical template, and the properties each csproj restated are deleted from it. The src csproj now carries only PackageId, Version, Description, TargetFrameworks, tags, icon and its own URLs. Tests and demo set GenerateDocumentationFile=false to opt back out of the new default -- sample and fixture code has no XML docs and TreatWarningsAsErrors would fail the build over every missing one. - 1.8: PackageOutputPath now points at artifacts/packages instead of a hardcoded C:\nuget-local\ dev feed, and GeneratePackageOnBuild is scoped to Release. A local dev feed is a personal preference, not repo config; even guarded to Windows it made one machine's layout part of the build. - 1.7: Microsoft.SourceLink.GitHub restored with PrivateAssets="All", at the estate-wide 10.0.400. It had been removed here as redundant, and that observation is correct as far as it goes -- see the proof below -- but the clause wants source linking pinned to a version the estate controls rather than moving with whichever SDK feature band happens to build. The 1.3 proof, packed before and after from a clean obj/ at the same commit (873d8a7) so SourceLink cannot embed two different git SHAs and move the MVID for reasons unrelated to the change: 1.2 + 1.3 + 1.8 alone, every entry in both packages: BYTE-IDENTICAL nuspec, README.md, icon.png, [Content_Types].xml, lib/{net8.0,net10.0}/*.dll, *.xml, and both *.pdb -- all `same`. Only _rels/.rels and the .psmdcp differ, both regenerated per pack. adding 1.7's SourceLink reference on top: nuspec, README, icon, and both XML doc files: still identical. Each .pdb grows 48 bytes; each .dll changes 72 of 34304 bytes, first at offset 137 (the PE header's deterministic stamp) -- consistent with the assembly's embedded PDB checksum moving, not with a code change. The source-link document map itself is unchanged: one blob either way, same raw.githubusercontent.com URL, same commit SHA. No duplicate blob. So the property/CPM migration is provably consumer-neutral, and the only package delta in this PR is the one 1.7 deliberately asks for. CHANGELOG: the [Unreleased] "Removed Microsoft.SourceLink.GitHub" entry is deleted rather than contradicted -- it never shipped, and leaving it beside its own reversal would be worse than either. The PackageOutputPath entry is rewritten, because 1.8 removes the dev feed outright rather than guarding it. Verified locally: Release build at zero warnings, 80 tests passing on both net8.0 and net10.0 with coverage collected, and no stray C:\ directory created anywhere in the tree. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 34 ++++++++++++------- Directory.Build.props | 33 ++++++++++++++++++ Directory.Packages.props | 14 ++++++++ ...teration.SpectreConsole.Splash.Demo.csproj | 6 ++-- ...NextIteration.SpectreConsole.Splash.csproj | 24 ++++--------- ...eration.SpectreConsole.Splash.Tests.csproj | 1 - 6 files changed, 80 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b28f2d..ddac09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **`Microsoft.SourceLink.GitHub` package reference restored** (§1.7), at the + estate-wide version 10.0.400 and with `PrivateAssets="All"` so it is never a + consumer dependency. It had been removed as redundant — the .NET 8+ SDK does emit + repository metadata and a source-link document map without it, which is accurate as + far as it goes — but the standard requires the explicit reference so that source + linking is pinned to a version the estate controls rather than moving with whichever + SDK feature band happens to build. The `.nuspec`, README, icon and XML docs are + unaffected; the assembly and symbols shift slightly (see below). - **Canonical CI shape, CodeQL and Dependabot** per [NextIteration.Standards](https://github.com/StuartMeeks/NextIteration.Standards) `STANDARD.md` section 3 and 4. `ci.yml` now splits into `build`, a three-platform @@ -26,6 +34,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **Central Package Management completed and shared build properties centralised.** + `Directory.Packages.props` gains `CentralPackageVersionOverrideEnabled=false`, so a + stray inline `Version=` alongside CPM is now a hard build failure instead of being + silently ignored (§1.3). The seventeen properties every project restated now live in + the root `Directory.Build.props` (§1.2); each csproj keeps only what is genuinely its + own. Non-shipping projects (tests, demo) set `GenerateDocumentationFile=false` to opt + back out. Verified behaviour-preserving: packed before and after from a clean `obj/` + at the same commit, every entry in both the `.nupkg` and `.snupkg` is byte-identical + bar the per-pack `.psmdcp` name. - **Adopted the standards baseline docs, editor config and SDK pin.** `SECURITY.md`, `CONTRIBUTING.md`, `CLAUDE.md` and a pull request template added; `.gitignore` and `.editorconfig` replaced with the canonical copies; `global.json` @@ -38,7 +55,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **`SplashTagline.RandomBuiltIn`'s XML doc corrected** from "~200 quotes" to "~300": the built-in pool holds 313 entries. Documentation only; the pool itself is unchanged. - - **Test suite migrated to xUnit.net v3 (`xunit.v3` 4.0.0)** from `xunit` 2.9.3. Contributor-facing only — no library code, public API, or shipped package contents changed. v3 test projects are self-executing console apps and run on @@ -53,19 +69,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 the suite ran on `net10.0` only. Running the full suite locally now requires the .NET 8 runtime alongside the .NET 10 SDK. -### Removed - -- **`Microsoft.SourceLink.GitHub` package reference.** The .NET SDK has bundled - SourceLink since .NET 8; the explicit reference was redundant. Verified - byte-identical `.nuspec` and `.snupkg` output either way — consumers still get - repository metadata and step-through sources. - ### Fixed -- **`PackageOutputPath` no longer breaks non-Windows builds.** The hardcoded - `C:\nuget-local\` local dev feed is now guarded to Windows; previously every - `dotnet build` on Linux/macOS and in CI created a literal `C:\nuget-local\` - directory under `src/`. +- **`PackageOutputPath` no longer points at a machine-local path.** Pack output + goes to `artifacts/packages` on every platform (§1.8). It previously pointed at + a hardcoded `C:\nuget-local\` dev feed; unguarded that created a literal + `C:\nuget-local\` directory under `src/` on Linux, macOS and in CI, and even + guarded to Windows it made one contributor's machine layout part of repo config. - **CI publish job could not check out the repo.** Its `permissions` block listed only `id-token: write`, and GitHub sets every unlisted scope to `none`, leaving `actions/checkout` without `contents: read`. diff --git a/Directory.Build.props b/Directory.Build.props index 08993bb..8447737 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,41 @@ + + 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 266a47c..36b9c02 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,12 +1,26 @@ true + + false + + + diff --git a/demo/NextIteration.SpectreConsole.Splash.Demo/NextIteration.SpectreConsole.Splash.Demo.csproj b/demo/NextIteration.SpectreConsole.Splash.Demo/NextIteration.SpectreConsole.Splash.Demo.csproj index 2151a8a..0bc124c 100644 --- a/demo/NextIteration.SpectreConsole.Splash.Demo/NextIteration.SpectreConsole.Splash.Demo.csproj +++ b/demo/NextIteration.SpectreConsole.Splash.Demo/NextIteration.SpectreConsole.Splash.Demo.csproj @@ -3,9 +3,11 @@ Exe net10.0 - enable - enable false + + false diff --git a/src/NextIteration.SpectreConsole.Splash/NextIteration.SpectreConsole.Splash.csproj b/src/NextIteration.SpectreConsole.Splash/NextIteration.SpectreConsole.Splash.csproj index 153949d..12625cf 100644 --- a/src/NextIteration.SpectreConsole.Splash/NextIteration.SpectreConsole.Splash.csproj +++ b/src/NextIteration.SpectreConsole.Splash/NextIteration.SpectreConsole.Splash.csproj @@ -1,37 +1,26 @@ + net8.0;net10.0 - enable - en - true - latest NextIteration.SpectreConsole.Splash 0.3.0 Configurable Figgle + Spectre.Console splash screen for .NET CLIs — gradient palette, pluggable tagline strategy, single-markup-call render path. - true - - C:\nuget-local\ + true + $(MSBuildThisFileDirectory)..\..\artifacts\packages true - MIT README.md https://github.com/StuartMeeks/NextIteration.SpectreConsole.Splash https://github.com/StuartMeeks/NextIteration.SpectreConsole.Splash.git git spectre;cli;splash;figgle;ascii-art icon.png - © Stuart Meeks - true - true - true - true - snupkg - portable - true @@ -42,6 +31,7 @@ + diff --git a/tests/NextIteration.SpectreConsole.Splash.Tests/NextIteration.SpectreConsole.Splash.Tests.csproj b/tests/NextIteration.SpectreConsole.Splash.Tests/NextIteration.SpectreConsole.Splash.Tests.csproj index 0a1b375..8f03bba 100644 --- a/tests/NextIteration.SpectreConsole.Splash.Tests/NextIteration.SpectreConsole.Splash.Tests.csproj +++ b/tests/NextIteration.SpectreConsole.Splash.Tests/NextIteration.SpectreConsole.Splash.Tests.csproj @@ -6,7 +6,6 @@ net8.0;net10.0 Exe - enable false true