Skip to content

Commit

Permalink
Don't include Description as compiler metadata unconditionally
Browse files Browse the repository at this point in the history
Since the description can contain newlines that will break the emitted editorconfig file with the values, only include in the specific scenario where we ensure the description isn't equal to the default.
  • Loading branch information
kzu committed Mar 11, 2023
1 parent 93b7bc9 commit dacf67c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CodeAnalysis/NuGetizer.CodeAnalysis.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<ItemGroup>
<CompilerVisibleProperty Include="IsPacking" />
<CompilerVisibleProperty Include="PackageId" />
<CompilerVisibleProperty Include="Description" />
<CompilerVisibleProperty Include="PackageIcon" />
<CompilerVisibleProperty Include="PackageIconUrl" />
<CompilerVisibleProperty Include="PackageReadmeFile" />
Expand All @@ -21,4 +20,13 @@
<CompilerVisibleProperty Include="AssemblyName" />
</ItemGroup>

<Target Name="_AddDescription" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun">
<ItemGroup>
<!-- We can't unconditionally emit Description since it can have newlines and that breaks editorconfig. -->
<CompilerVisibleProperty Include="Description" Condition="$(Description) == 'Package Description'" />
</ItemGroup>
</Target>

<Import Project="Devlooped.SponsorLink.targets" Condition="Exists('Devlooped.SponsorLink.targets')" />

</Project>

0 comments on commit dacf67c

Please sign in to comment.