Skip to content

Conversation

@Shane32
Copy link
Owner

@Shane32 Shane32 commented Oct 3, 2025

Summary by CodeRabbit

  • Packaging

    • Centralized and expanded package metadata, deterministic builds, and inclusion of README/icon for packable releases; packable defaults standardized.
  • Signing

    • Conditional strong-name signing enabled for release packages.
  • Platform Support

    • Tightened Windows compilation gating for consistent XAML-related builds across targets.
  • Quality & CI

    • Enabled analyzers, stricter warning handling, and CI-aware build behavior for more consistent outputs.
  • Cleanup

    • Removed legacy assembly metadata files in favor of modern project configuration.

@Shane32 Shane32 self-assigned this Oct 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

📝 Walkthrough

Walkthrough

Centralizes MSBuild packaging, signing, and analyzer settings in Directory.Build.props/targets; removes per-project AssemblyInfo files; updates many .csproj files to rely on centralized properties, adjust IsPackable/signing/COM settings, and change conditional compilation symbols and test/resource configurations.

Changes

Cohort / File(s) Summary
Centralized build & packaging
Directory.Build.props, Directory.Build.targets, QRCoder.sln
Add global NuGet/package metadata, analyzer/warning settings, deterministic/embedded PDBs, CI-conditioned properties, README/icon packing for packable projects; define SYSTEM_DRAWING and HAS_SPAN; enable Release signing for packable projects; include targets in solution items.
Remove per-project AssemblyInfo
QRCoder/Properties/AssemblyInfo.cs, QRCoder.Xaml/Properties/AssemblyInfo.cs, QRCoderConsole/Properties/AssemblyInfo.cs, QRCoderDemo/Properties/AssemblyInfo.cs, QRCoderDemoUWP/Properties/AssemblyInfo.cs
Delete assembly-level attribute files (title/description/version/COM/GUID/signing attributes) that are now handled centrally or by SDK defaults.
Core library project updates
QRCoder/QRCoder.csproj
Set IsPackable=true, add PackageTags, AssemblyOriginatorKeyFile, ComVisible, Guid; remove prior per-project packaging/signing metadata.
XAML library project updates
QRCoder.Xaml/QRCoder.Xaml.csproj
Set IsPackable=true, add AssemblyOriginatorKeyFile, ComVisible, Guid, PackageTags; remove per-project packaging/signing metadata and adjust README packaging handling.
Console project updates
QRCoderConsole/QRCoderConsole.csproj
Remove conditional DefineConstants for windows TFMs, ExternalConsole, and GenerateAssemblyInfo.
Console source conditional changes
QRCoderConsole/DataObjects/SupportedImageFormat.cs, QRCoderConsole/Program.cs
Tighten/modify compilation gating: replace NET5_0_WINDOWS/NET6_0_WINDOWS with WINDOWS or NET6_0 && WINDOWS, altering when XAML/Windows-specific code is compiled.
API tests project change
QRCoderApiTests/QRCoderApiTests.csproj
Remove IsTestProject flag.
Unit tests project changes
QRCoderTests/QRCoderTests.csproj
Remove per-target DefineConstants, consolidate RuntimeFrameworkVersion handling, replace explicit embedded resources with wildcard patterns, and reorganize test package/project references.
Trim analysis project changes
QRCoderTrimAnalysis/QRCoderTrimAnalysis.csproj
Remove TreatWarningsAsErrors and IsPackable=false entries.
Demo project cleanup
QRCoderDemo/QRCoderDemo.csproj
Remove GenerateAssemblyInfo and empty conditional PropertyGroups; minor whitespace adjustments.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Dev as Developer / CI
    participant MSBuild as MSBuild (dotnet build / pack)
    participant Props as Directory.Build.props
    participant Targets as Directory.Build.targets
    participant Project as Individual .csproj
    participant NuGet as NuGet/publish

    Dev->>MSBuild: run build/pack
    MSBuild->>Props: import global properties
    MSBuild->>Project: apply project file (overrides)
    MSBuild->>Targets: import global targets
    Targets->>Project: inject defines (SYSTEM_DRAWING,HAS_SPAN) and signing rules
    Project->>MSBuild: evaluated build graph
    alt IsPackable == true
      MSBuild->>NuGet: pack using Package metadata (README/icon included)
      NuGet-->>MSBuild: package created
    else
      MSBuild-->>Dev: build output only
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related issues

  • Centralize msbuild props #610 — Centralizes MSBuild props/targets and packaging/analyzer consolidation, matching this PR's centralization of build metadata.

Possibly related PRs

Suggested reviewers

  • codebude
  • gfoidl

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit's high-level summary is enabled.
Title Check ✅ Passed The title accurately reflects the primary focus of the changes by describing both the cleanup of project files and the configuration of Directory.Build.props, concisely conveying the main scope of the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cleanup_csproj

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5522e48 and f50805e.

📒 Files selected for processing (2)
  • QRCoder.Xaml/QRCoder.Xaml.csproj (2 hunks)
  • QRCoderTests/QRCoderTests.csproj (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: additional-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
QRCoderConsole/Program.cs (1)

164-174: Define the WINDOWS symbol in QRCoderConsole.csproj
There’s no WINDOWS constant defined, so the #if WINDOWS block (Program.cs lines 164–174) will never be included. Under the net5.0-windows and net6.0-windows <PropertyGroup> in QRCoderConsole.csproj add:

<DefineConstants>WINDOWS;$(DefineConstants)</DefineConstants>

or revert to using the built-in NET5_0_WINDOWS | NET6_0_WINDOWS symbols.

♻️ Duplicate comments (1)
QRCoderConsole/Program.cs (1)

238-240: Same symbol definition concern as lines 12-14.

The conditional compilation change here mirrors the one at lines 12-14. Ensure the NET6_0 and WINDOWS symbols are properly defined (see comment on lines 12-14).

🧹 Nitpick comments (1)
QRCoder/QRCoder.csproj (1)

8-8: Redundant NoWarn directive.

The CS1591 warning is already suppressed in Directory.Build.props line 40. This duplicate suppression can be removed.

-    <NoWarn>$(NoWarn);CS1591</NoWarn>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 434e7be and 1edf3c0.

⛔ Files ignored due to path filters (2)
  • QRCoder.Xaml/Assets/nuget-icon-xaml.png is excluded by !**/*.png
  • nuget-icon.png is excluded by !**/*.png
📒 Files selected for processing (17)
  • Directory.Build.props (1 hunks)
  • Directory.Build.targets (1 hunks)
  • QRCoder.Xaml/Properties/AssemblyInfo.cs (0 hunks)
  • QRCoder.Xaml/QRCoder.Xaml.csproj (2 hunks)
  • QRCoder.sln (1 hunks)
  • QRCoder/Properties/AssemblyInfo.cs (0 hunks)
  • QRCoder/QRCoder.csproj (1 hunks)
  • QRCoderApiTests/QRCoderApiTests.csproj (0 hunks)
  • QRCoderConsole/DataObjects/SupportedImageFormat.cs (1 hunks)
  • QRCoderConsole/Program.cs (3 hunks)
  • QRCoderConsole/Properties/AssemblyInfo.cs (0 hunks)
  • QRCoderConsole/QRCoderConsole.csproj (0 hunks)
  • QRCoderDemo/Properties/AssemblyInfo.cs (0 hunks)
  • QRCoderDemo/QRCoderDemo.csproj (1 hunks)
  • QRCoderDemoUWP/Properties/AssemblyInfo.cs (0 hunks)
  • QRCoderTests/QRCoderTests.csproj (2 hunks)
  • QRCoderTrimAnalysis/QRCoderTrimAnalysis.csproj (0 hunks)
💤 Files with no reviewable changes (8)
  • QRCoderTrimAnalysis/QRCoderTrimAnalysis.csproj
  • QRCoderDemoUWP/Properties/AssemblyInfo.cs
  • QRCoderConsole/QRCoderConsole.csproj
  • QRCoder.Xaml/Properties/AssemblyInfo.cs
  • QRCoderApiTests/QRCoderApiTests.csproj
  • QRCoderConsole/Properties/AssemblyInfo.cs
  • QRCoderDemo/Properties/AssemblyInfo.cs
  • QRCoder/Properties/AssemblyInfo.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: additional-tests
🔇 Additional comments (9)
QRCoder.sln (1)

28-28: LGTM!

Adding Directory.Build.targets to the Solution Items maintains consistency with the existing pattern for Directory.Build.props and improves visibility of build configuration files in Visual Studio.

QRCoderDemo/QRCoderDemo.csproj (1)

1-25: LGTM!

The cleanup changes align with the centralized build configuration strategy. Removing redundant settings and empty property groups improves maintainability without affecting functionality.

Directory.Build.targets (1)

1-15: LGTM with note on WINDOWS constant.

The conditional compilation constants and signing configuration look correct:

  • SYSTEM_DRAWING appropriately excludes frameworks without built-in System.Drawing support
  • HAS_SPAN correctly targets frameworks with Span support
  • Strong-name signing is properly scoped to Release builds of packable projects

However, note that this file does not define a WINDOWS constant, which is referenced in QRCoderConsole/DataObjects/SupportedImageFormat.cs line 11. That may need to be addressed (see comment on that file).

QRCoderTests/QRCoderTests.csproj (1)

1-61: LGTM!

The changes improve maintainability:

  • Conditional RuntimeFrameworkVersion is properly scoped to netcoreapp2.1
  • Wildcard patterns for embedded resources (assets/*.svg and assets/*.png) are cleaner than explicit file listings
  • Removal of redundant properties aligns with centralized configuration
QRCoder.Xaml/QRCoder.Xaml.csproj (2)

5-5: LGTM!

The condition correctly applies WPF to both net5.0-windows and net6.0-windows targets.


28-30: LGTM!

The package-specific readme is properly configured with the None Update item.

Directory.Build.props (3)

3-11: LGTM!

The comment block clearly documents the MSBuild property evaluation order, which is helpful for understanding how Directory.Build.props/targets interact with individual project files.


12-43: LGTM! Consider clarifying analyzer configuration.

The centralized build and packaging configuration is well-structured and comprehensive. The combination of EnableNETAnalyzers=True with AnalysisMode=None (lines 41-42) is unusual but may be intentional to disable default rulesets while allowing explicit analyzer configuration in individual projects or .editorconfig.

If the intent is to use custom analyzer rules, consider adding a comment explaining why AnalysisMode=None is used with EnableNETAnalyzers=True.


46-49: LGTM!

Conditional inclusion of README and icon for packable projects is well-structured and uses proper MSBuild properties.

Comment on lines -7 to -14
[assembly: AssemblyTitle("QRCoder")]
[assembly: AssemblyDescription("QRCoder is a simple library, written in C#.NET, which enables you to create QR Codes. It's licensed under the MIT-license.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("www.code-bude.net")]
[assembly: AssemblyProduct("QRCoder")]
[assembly: AssemblyCopyright("Copyright © www.code-bude.net / Raffael Herrmann. All rights reserved.")]
[assembly: AssemblyTrademark("written by Raffael Herrmann")]
[assembly: AssemblyCulture("")]
Copy link
Owner Author

@Shane32 Shane32 Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concentrating on what appears in NuGet, not what's compiled into the assembly. So some of these have been omitted in Directory.Build.props because NuGet ignores them, or because they already default to the correct value.

[assembly: ComVisible(true)]

// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("e668b98b-83bb-4e60-b33c-4fd5ed9c0156")]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old GUID for COM was incorrectly set the same as the QRCoder's GUID. A new GUID has been assigned for QRCoder.Xaml.

@Shane32 Shane32 requested a review from gfoidl October 3, 2025 01:05
@Shane32 Shane32 linked an issue Oct 3, 2025 that may be closed by this pull request
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.

Centralize msbuild props

3 participants