net-daemon / netdaemon

An application daemon for Home Assistant written in .NET
MIT License
226 stars 64 forks source link

Output documentation in nuget #905

Closed svrooij closed 1 year ago

svrooij commented 1 year ago

It appears that even though there is a lot of code documentation, that documentation is not included in the nuget packages. To do this, you have to change the project files of the respective project(s).

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    ...
    <GenerateDocumentationFile>True</GenerateDocumentationFile>
    ...
  </PropertyGroup>
</Project>

This will also enable warnings for public items without comment, so to clean up the list, you might want to add this as well:

<Project Sdk="Microsoft.NET.Sdk">
  ...
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <NoWarn>1701;1702</NoWarn> <!-- add these to also hide the warnings during development ;CS1591;CS1573 -->
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <NoWarn>1701;1702;CS1591;CS1573</NoWarn>
  </PropertyGroup>
  ...
</Project>

This change will make sure that documentation like this, is included in the nuget. You’ll see that data when editing your personal netdeamon apps. https://github.com/net-daemon/netdaemon/blob/8382bd0c1ddd9ed1f2fc586090900b3ac4920c6f/src/Runtime/NetDaemon.Runtime/Common/Extensions/HostBuilderExtensions.cs#L10-L24

helto4real commented 1 year ago

Great suggestion.

svrooij commented 1 year ago

I'll start with this issue, expect a pr soon