feat: add GenerateDocumentationFile setting#15
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables XML documentation generation for each library and ensures the generated .xml files are copied alongside their DLLs into the bin folders.
- Added
<GenerateDocumentationFile>true</GenerateDocumentationFile>to each project file - Updated
Directory.Build.targetsin each module to copy the corresponding.xmlalongside the.dll
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/LocalPrefs/LocalPrefs.csproj | Enabled XML docs generation via GenerateDocumentationFile |
| src/LocalPrefs/Directory.Build.targets | Added copy step for LocalPrefs.Core.xml |
| src/LocalPrefs.MessagePack/LocalPrefs.MessagePack.csproj | Enabled XML docs generation for MessagePack library |
| src/LocalPrefs.MessagePack/Directory.Build.targets | Added copy step for LocalPrefs.MessagePack.xml |
| src/LocalPrefs.Json/LocalPrefs.Json.csproj | Enabled XML docs generation for JSON library |
| src/LocalPrefs.Json/Directory.Build.targets | Added copy step for LocalPrefs.Json.xml |
Comments suppressed due to low confidence (1)
src/LocalPrefs/Directory.Build.targets:6
- [nitpick] The copy logic for DLLs and XMLs is duplicated across multiple modules—consider factoring this into a shared MSBuild target to reduce repetition and simplify future updates.
<Copy SourceFiles="$(OutputPath)/LocalPrefs.Core.dll" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Core" SkipUnchangedFiles="true" />
| <Message Text="OutputPath : $(OutputPath)" Importance="high" /> | ||
| <Message Text="MSBuildThisFileDirectory : $(MSBuildThisFileDirectory)" Importance="high" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Core.dll" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Core" SkipUnchangedFiles="true" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Core.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Core" SkipUnchangedFiles="true" /> |
There was a problem hiding this comment.
Add a Condition to this Copy task to ensure the XML file exists before copying, e.g., <Copy Condition="Exists('$(OutputPath)/LocalPrefs.Core.xml')" ... /> to avoid build errors when the file is missing.
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Core.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Core" SkipUnchangedFiles="true" /> | |
| <Copy Condition="Exists('$(OutputPath)/LocalPrefs.Core.xml')" SourceFiles="$(OutputPath)/LocalPrefs.Core.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Core" SkipUnchangedFiles="true" /> |
| <Message Text="OutputPath : $(OutputPath)" Importance="high" /> | ||
| <Message Text="MSBuildThisFileDirectory : $(MSBuildThisFileDirectory)" Importance="high" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.MessagePack.dll" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.MessagePack" SkipUnchangedFiles="true" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.MessagePack.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.MessagePack" SkipUnchangedFiles="true" /> |
There was a problem hiding this comment.
Guard the copy with a Condition="Exists('$(OutputPath)/LocalPrefs.MessagePack.xml')" so the build won’t fail if the XML documentation isn’t generated.
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.MessagePack.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.MessagePack" SkipUnchangedFiles="true" /> | |
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.MessagePack.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.MessagePack" SkipUnchangedFiles="true" Condition="Exists('$(OutputPath)/LocalPrefs.MessagePack.xml')" /> |
| <Message Text="OutputPath : $(OutputPath)" Importance="high" /> | ||
| <Message Text="MSBuildThisFileDirectory : $(MSBuildThisFileDirectory)" Importance="high" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Json.dll" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Json" SkipUnchangedFiles="true" /> | ||
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Json.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Json" SkipUnchangedFiles="true" /> |
There was a problem hiding this comment.
Add a Condition check for the XML file’s existence (Exists('$(OutputPath)/LocalPrefs.Json.xml')) to prevent unnecessary build warnings or errors.
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Json.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Json" SkipUnchangedFiles="true" /> | |
| <Copy SourceFiles="$(OutputPath)/LocalPrefs.Json.xml" DestinationFolder="$(MSBuildThisFileDirectory)../../bin/LocalPrefs.Json" SkipUnchangedFiles="true" Condition="Exists('$(OutputPath)/LocalPrefs.Json.xml')" /> |
No description provided.