Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saucecontrol committed Nov 26, 2023
1 parent d43b5b5 commit 5b6693b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
15 changes: 12 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
InheritDoc
==========

This [MSBuild Task]( https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-tasks) automatically replaces `<inheritdoc />` tags in your .NET XML documentation with the actual inherited docs. By integrating with MSBuild, this tool has access to the exact arguments passed to the compiler -- including all assembly references -- making it both simpler and more capable than other documentation post-processing tools. As it processes `<inheritdoc />` elements, it is able to accurately resolve base types whether they come from the target framework, referenced NuGet packages, or project references. This allows intelligent mapping of documentation from base types and members to yours. For example, it can identify when you change the name of a method parameter from the base type’s definition and update the documentation accordingly. It can also remove documentation for non-public types/members to reduce the size of your published XML docs.
This [MSBuild Task]( https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-tasks) automatically replaces `<inheritdoc />` tags in your .NET XML documentation with the actual inherited docs.

How to Use It
-------------

1) Add some `<inheritdoc />` tags to your XML documentation comments.

This tool’s handling of `<inheritdoc />` tags is based on the draft [design document]( https://github.com/dotnet/csharplang/blob/812e220fe2b964d17f353cb684aa341418618b6e/proposals/inheritdoc.md) used for Roslyn's support in Visual Studio, which is in turn based on the `<inheritdoc />` support in [Sandcastle Help File Builder]( https://ewsoftware.github.io/XMLCommentsGuide/html/86453FFB-B978-4A2A-9EB5-70E118CA8073.htm#TopLevelRules) (SHFB).
This tool’s handling of `<inheritdoc />` tags is based on the [design document]( https://github.com/dotnet/csharplang/blob/812e220fe2b964d17f353cb684aa341418618b6e/proposals/inheritdoc.md) used for Roslyn's support in Visual Studio, which is in turn based on the `<inheritdoc />` support in [Sandcastle Help File Builder]( https://ewsoftware.github.io/XMLCommentsGuide/html/86453FFB-B978-4A2A-9EB5-70E118CA8073.htm#TopLevelRules) (SHFB).

2) Add the [SauceControl.InheritDoc](https://www.nuget.org/packages/SauceControl.InheritDoc) NuGet package reference to your project.

Expand All @@ -20,6 +20,15 @@ How to Use It

The XML docs will be post-processed automatically with each non-debug build, whether you use Visual Studio, dotnet CLI, or anything else that hosts the MSBuild engine.

Additional Features
-------------------

* Updates the contents of inherited docs to replace `param` and `typeparam` names that changed in the inheriting type or member.

* Supports trimming your published XML doc files of any types or members not publicly visible in your API.

* Validates your usage of `<inheritdoc />` and warns you if no documentation exists or if your `cref`s or `path`s are incorrect.

How it Works
------------

Expand Down Expand Up @@ -309,4 +318,4 @@ When it runs, `InheritDocTask` will log a success message to the build output fo
InheritDocTask replaced 55 of 55 inheritdoc tags and removed 60 non-public member docs in /path/to/MyProject.xml
```

If you don't see the message(s), it didn't run for some reason. Check the detailed output from MSBuild (e.g. `dotnet build -v detailed`) and look for `InheritDoc` in the logs for clues. Issue reports are, of course, welcome with good repro steps.
If you don't see the message(s), it didn't run for some reason. Check the detailed output from MSBuild (e.g. `dotnet build -v detailed`) or use the [MSBuild Log Viewer](https://msbuildlog.com/) and look for `InheritDoc` in the logs for clues. Issue reports are, of course, welcome with good repro steps.
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)'=='Dist' or '$(Configuration)'=='Coverage'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'!='Dist'">
<InternalsVisibleTo Include="$(MSBuildProjectName).Test" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/InheritDoc/CecilExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public AssemblyDefinition Resolve(AssemblyNameReference name)
public void Dispose()
{
foreach (var asm in cache.Values)
asm.Dispose();
asm?.Dispose();

cache.Clear();
}
Expand Down
13 changes: 11 additions & 2 deletions src/InheritDoc/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
InheritDoc
==========

This [MSBuild Task]( https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-tasks) automatically replaces `<inheritdoc />` tags in your .NET XML documentation with the actual inherited docs. By integrating with MSBuild, this tool has access to the exact arguments passed to the compiler -- including all assembly references -- making it both simpler and more capable than other documentation post-processing tools. As it processes `<inheritdoc />` elements, it is able to accurately resolve base types whether they come from the target framework, referenced NuGet packages, or project references. This allows intelligent mapping of documentation from base types and members to yours. For example, it can identify when you change the name of a method parameter from the base type’s definition and update the documentation accordingly. It can also remove documentation for non-public types/members to reduce the size of your published XML docs.
This [MSBuild Task]( https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-tasks) automatically replaces `<inheritdoc />` tags in your .NET XML documentation with the actual inherited docs.

How to Use It
-------------

1) Add some `<inheritdoc />` tags to your XML documentation comments.

This tool’s handling of `<inheritdoc />` tags is based on the draft [design document]( https://github.com/dotnet/csharplang/blob/812e220fe2b964d17f353cb684aa341418618b6e/proposals/inheritdoc.md) used for Roslyn's support in Visual Studio, which is in turn based on the `<inheritdoc />` support in [Sandcastle Help File Builder]( https://ewsoftware.github.io/XMLCommentsGuide/html/86453FFB-B978-4A2A-9EB5-70E118CA8073.htm#TopLevelRules) (SHFB).
This tool’s handling of `<inheritdoc />` tags is based on the [design document]( https://github.com/dotnet/csharplang/blob/812e220fe2b964d17f353cb684aa341418618b6e/proposals/inheritdoc.md) used for Roslyn's support in Visual Studio, which is in turn based on the `<inheritdoc />` support in [Sandcastle Help File Builder]( https://ewsoftware.github.io/XMLCommentsGuide/html/86453FFB-B978-4A2A-9EB5-70E118CA8073.htm#TopLevelRules) (SHFB).

2) Add the [SauceControl.InheritDoc](https://www.nuget.org/packages/SauceControl.InheritDoc) NuGet package reference to your project.

Expand All @@ -18,4 +18,13 @@ How to Use It

The XML docs will be post-processed automatically with each non-debug build, whether you use Visual Studio, dotnet CLI, or anything else that hosts the MSBuild engine.

Additional Features
-------------------

* Updates the contents of inherited docs to replace `param` and `typeparam` names that changed in the inheriting type or member.

* Supports trimming your published XML doc files of any types or members not publicly visible in your API.

* Validates your usage of `<inheritdoc />` and warns you if no documentation exists or if your `cref`s or `path`s are incorrect.

For more details and examples, see the [project home page](https://github.com/saucecontrol/InheritDoc)

0 comments on commit 5b6693b

Please sign in to comment.