Skip to content

[Implement] Directory.Build.props and Directory.Packages.props; fixes #404 - #405

Open
samatstariongroup wants to merge 2 commits into
developmentfrom
GH404-directory-build-props
Open

samatstariongroup wants to merge 2 commits into
developmentfrom
GH404-directory-build-props

Conversation

@samatstariongroup

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the COMET-SDK code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

Closes #404. Moves the build settings and NuGet package versions that were repeated in every .csproj into two files at the repository root (877 lines removed from the project files).

Directory.Build.props

  • All projects: Company, Copyright, RepositoryUrl, LangVersion.
  • Library projects: all NuGet package metadata (licence, icon, README, symbols, SBOM, documentation, …), the packed icon/README/licence files, Microsoft.Sbom.Targets and VersionPrefix.
  • Test projects (project name ends in Tests): IsPackable=false and the seven test packages every test project used (NUnit, NUnit.Console, NUnit3TestAdapter, Moq, Microsoft.NET.Test.Sdk, coverlet.collector, coverlet.msbuild).
  • A library .csproj now only sets TargetFrameworks, Title, Description, PackageId, PackageReleaseNotes, PackageTags where it differs from the default, and its references.

Directory.Packages.props

  • Enables Central Package Management and sets the version of all 37 packages. PackageReference items have no Version attribute any more.
  • Microsoft.NETFramework.ReferenceAssemblies is a GlobalPackageReference.

Other changes

  • versionBump.sh updates VersionPrefix in Directory.Build.props, and stops on errors or when the file is missing.
  • CLAUDE.md, AGENTS.md and the update-package-release-notes skill describe where versions now live. CLAUDE.md and AGENTS.md also get corrected target frameworks.
  • Removed the stale CDP4Web.Tests/CDP4Web - Backup.Tests.csproj (targeted net8.0, not in the solution).

Package metadata changes (all other package content is unchanged)

  • CDP4RequirementsVerification-CE, CDP4Rules-CE, CDP4ServicesDal-CE and CDP4Web-CE now include projectUrl; they did not set PackageProjectUrl before.
  • CDP4ServicesMessaging-CE had the title "CDP4Common Community Edition"; it is now "CDP4ServicesMessaging Community Edition".

Not changed: the direct references that override vulnerable or outdated transitive dependencies are kept as they were, with their versions now in Directory.Packages.props. CentralPackageTransitivePinningEnabled is not turned on, because it would add the pinned packages as dependencies of the other published packages. That can be a separate change.

Directory.Build.targets is not added: the repository has no custom targets or logic that must run after the project file.

Verification

  • dotnet build: 0 errors. dotnet test (excluding WebServicesDependent and CICDExclusion): 17 test projects, 2445 passed, 0 failed, on net48 and net10.0.
  • dotnet pack -c Release before and after: the same 12 .nupkg and 12 .snupkg. File lists (dll, xml docs, pdb, SBOM, icon, README, licence files) and dependency groups are identical; the only nuspec differences are the metadata changes above.
  • dotnet list CDP4-SDK.sln package --outdated --include-transitive (used by nuget-reference-check.yml) still works under Central Package Management.
  • Not yet confirmed: the net48 build on the Linux runner, which relies on the central Microsoft.NETFramework.ReferenceAssemblies reference; the CodeQuality workflow on this PR covers it.

This PR also contains the commit [Fix] Target frameworks in CLAUDE.md, which was not yet pushed to development.

🤖 Generated with Claude Code

samatstarion and others added 2 commits October 21, 2026 08:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…404

- Directory.Build.props holds the settings shared by all projects, the
  NuGet package metadata and VersionPrefix of the library projects, and
  IsPackable=false plus the common test packages of the test projects
- Directory.Packages.props enables Central Package Management and sets
  the version of every NuGet package
- Remove the duplicated settings and package versions from all projects
- versionBump.sh updates VersionPrefix in Directory.Build.props and stops
  on errors
- Fix the package title of CDP4ServicesMessaging
- Remove the stale CDP4Web - Backup.Tests.csproj
- Document the build configuration in CLAUDE.md, AGENTS.md and the
  update-package-release-notes skill

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Directory.Build.props and Directory.Packages.props to centralise build settings and package versions

1 participant