Skip to content

Commit 967c78a

Browse files
committed
More tweaks
1 parent 516ad75 commit 967c78a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

nuget/Microsoft.Windows.CsWinRT.targets

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ Copyright (C) Microsoft Corporation. All rights reserved.
7474
<!--
7575
If 'CsWinRTHasAnyIncludes' is 'false', but 'CsWinRTIncludes' is not actually empty, treat it as
7676
a 'string', and also account for people formatting it over multiple lines in the .csproj files.
77-
That is, we trim it, normalize separators and remove all newline characters, and then check
78-
whether the result is not empty. If not, then we do have some WinRT includes.
77+
That is, we trim it and remove all newline characters, and then check whether the result is not
78+
empty. If not, then we do have some WinRT includes.
79+
7980
This handles eg. Win2D setting this property like so:
8081
8182
'''
8283
<CSWinRTIncludes>
83-
Microsoft.Graphics.Canvas;
84-
</CSWinRTIncludes>
84+
Microsoft.Graphics.Canvas;
85+
</CSWinRTIncludes>
8586
'''
8687
-->
87-
<CsWinRTIncludesWithFixup>$(CSWinRTIncludes)</CsWinRTIncludesWithFixup>
88-
<CsWinRTIncludesWithFixup>$(CsWinRTIncludesWithFixup.Trim())</CsWinRTIncludesWithFixup>
89-
<CsWinRTIncludesWithFixup>$(CsWinRTIncludesWithFixup.Replace(';', ','))</CsWinRTIncludesWithFixup>
90-
<CsWinRTIncludesWithFixup>$([System.Text.RegularExpressions.Regex]::Replace($(CsWinRTIncludesWithFixup), '[\r\n]', ''))</CsWinRTIncludesWithFixup>
88+
<CsWinRTIncludesWithFixup Condition="'$(CsWinRTHasAnyIncludes)' == 'false'">$(CSWinRTIncludes)</CsWinRTIncludesWithFixup>
89+
<CsWinRTIncludesWithFixup Condition="'$(CsWinRTHasAnyIncludes)' == 'false'">$(CsWinRTIncludesWithFixup.Trim())</CsWinRTIncludesWithFixup>
90+
<CsWinRTIncludesWithFixup Condition="'$(CsWinRTHasAnyIncludes)' == 'false'">$([System.Text.RegularExpressions.Regex]::Replace($(CsWinRTIncludesWithFixup), '[\r\n]', ''))</CsWinRTIncludesWithFixup>
9191
<CsWinRTHasAnyIncludes Condition="'$(CsWinRTIncludesWithFixup)' != ''">true</CsWinRTHasAnyIncludes>
9292

9393
<!--

0 commit comments

Comments
 (0)