Skip to content

Commit

Permalink
Improve default value for GenerateDocumentationFile
Browse files Browse the repository at this point in the history
IsTestProject=true is a better check, and is added by xunit via .props, so we move the defaulting to .targets.
  • Loading branch information
kzu committed Jul 2, 2024
1 parent 96ca2b1 commit b76de49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@

<PropertyGroup Label="Build">
<Configuration Condition="'$(Configuration)' == '' and $(CI)">Release</Configuration>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="$(MSBuildProjectName.Contains('Tests'))">false</GenerateDocumentationFile>
<LangVersion>Latest</LangVersion>

<!-- See https://docs.microsoft.com/en-us/dotnet/standard/assembly/reference-assemblies -->
Expand Down
7 changes: 7 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<PropertyGroup Condition="'$(CI)' == 'true' and '$(Language)' == 'C#'">
<DefineConstants>CI;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Label="Build">
<!-- Tests projects don't need API docs, typically -->
<GenerateDocumentationFile Condition="$(GenerateDocumentationFile) == '' and $(IsTestProject) == 'true'">false</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="$(GenerateDocumentationFile) == '' amd $(MSBuildProjectName.Contains('Tests'))">false</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="$(GenerateDocumentationFile) == ''">true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)' == ''">
<IsPackable Condition="'$(PackAsTool)' == 'true'">true</IsPackable>
Expand Down

0 comments on commit b76de49

Please sign in to comment.