Skip to content

Commit 2a32db2

Browse files
committed
Don't include Description as compiler metadata unconditionally
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.
1 parent 86904f4 commit 2a32db2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/CodeAnalysis/NuGetizer.CodeAnalysis.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ItemGroup>
44
<CompilerVisibleProperty Include="IsPacking" />
55
<CompilerVisibleProperty Include="PackageId" />
6-
<CompilerVisibleProperty Include="Description" />
76
<CompilerVisibleProperty Include="PackageIcon" />
87
<CompilerVisibleProperty Include="PackageIconUrl" />
98
<CompilerVisibleProperty Include="PackageReadmeFile" />
@@ -22,4 +21,13 @@
2221
</ItemGroup>
2322
<Import Project="Devlooped.SponsorLink.targets" Condition="Exists('Devlooped.SponsorLink.targets')" />
2423

24+
<Target Name="_AddDescription" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun">
25+
<ItemGroup>
26+
<!-- We can't unconditionally emit Description since it can have newlines and that breaks editorconfig. -->
27+
<CompilerVisibleProperty Include="Description" Condition="$(Description) == 'Package Description'" />
28+
</ItemGroup>
29+
</Target>
30+
31+
<Import Project="Devlooped.SponsorLink.targets" Condition="Exists('Devlooped.SponsorLink.targets')" />
32+
2533
</Project>

0 commit comments

Comments
 (0)