|
98 | 98 | </ItemGroup>
|
99 | 99 |
|
100 | 100 | <ItemGroup>
|
101 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\*.vstemplate" /> |
102 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\__*.png" /> |
103 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\obj\**" /> |
104 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\bin\**" /> |
105 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\Properties\**" /> |
106 |
| - <_UnoAppnet6TemplateFilesExclude Include="..\UnoSolutionTemplate.net6\UnoSolutionTemplate.csproj" /> |
107 |
| - |
108 |
| - <_UnoAppnet6TemplateFiles Include="..\UnoSolutionTemplate.net6\**" Exclude="@(_UnoAppnet6TemplateFilesExclude)" /> |
| 101 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\*.vstemplate" /> |
| 102 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\__*.png" /> |
| 103 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\obj\**" /> |
| 104 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\**\bin\**" /> |
| 105 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\Properties\**" /> |
| 106 | + <_UnoAppnet6UWPTemplateFilesExclude Include="..\UnoSolutionTemplate.net6\UnoSolutionTemplate.csproj" /> |
| 107 | + |
| 108 | + <_UnoAppnet6UWPTemplateFiles Include="..\UnoSolutionTemplate.net6\**" Exclude="@(_UnoAppnet6UWPTemplateFilesExclude)" /> |
| 109 | + </ItemGroup> |
| 110 | + |
| 111 | + <ItemGroup> |
| 112 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\**\*.vstemplate" /> |
| 113 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\__*.png" /> |
| 114 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\**\obj\**" /> |
| 115 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\**\bin\**" /> |
| 116 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\Properties\**" /> |
| 117 | + <_UnoAppnet6WinUITemplateFilesExclude Include="..\UnoSolutionTemplate.WinUI.net6\UnoSolutionTemplate.csproj" /> |
| 118 | + |
| 119 | + <_UnoAppnet6WinUITemplateFiles Include="..\UnoSolutionTemplate.WinUI.net6\**" Exclude="@(_UnoAppnet6WinUITemplateFilesExclude)" /> |
109 | 120 | </ItemGroup>
|
110 | 121 |
|
111 | 122 | <ItemGroup>
|
|
171 | 182 |
|
172 | 183 | <RemoveDir Directories="$(IntermediateTemplatePath)" />
|
173 | 184 |
|
174 |
| - <Copy SourceFiles="@(_UnoAppnet6TemplateFiles)" DestinationFolder="$(IntermediateTemplatePath)\%(RecursiveDir)" /> |
| 185 | + <Copy SourceFiles="@(_UnoAppnet6UWPTemplateFiles)" DestinationFolder="$(IntermediateTemplatePath)\%(RecursiveDir)" /> |
175 | 186 |
|
176 | 187 | <ReplaceContent SourcePath="$(IntermediateTemplatePath)" SafeProjectName="UnoQuickStart" IsWinUI="False" />
|
177 | 188 |
|
|
248 | 259 |
|
249 | 260 | <RemoveDir Directories="$(IntermediateTemplatePath)" />
|
250 | 261 |
|
251 |
| - <Copy SourceFiles="@(_UnoAppnet6TemplateFiles)" DestinationFolder="$(IntermediateTemplatePath)\%(RecursiveDir)" /> |
| 262 | + <Copy SourceFiles="@(_UnoAppnet6WinUITemplateFiles)" DestinationFolder="$(IntermediateTemplatePath)\%(RecursiveDir)" /> |
252 | 263 |
|
253 | 264 | <ReplaceContent SourcePath="$(IntermediateTemplatePath)" SafeProjectName="UnoQuickStart" IsWinUI="True" />
|
254 | 265 | <RenameSolution SourcePath="$(IntermediateTemplatePath)" SourceName="UnoQuickStart" TargetName="UnoWinUIQuickStart" />
|
|
280 | 291 | <Task>
|
281 | 292 | <Reference Include="System.Xml" />
|
282 | 293 | <Using Namespace="System" />
|
| 294 | + <Using Namespace="System.Text.RegularExpressions" /> |
283 | 295 | <Using Namespace="System.Linq" />
|
284 | 296 | <Using Namespace="System.IO" />
|
285 | 297 | <Code Type="Fragment" Language="cs">
|
|
303 | 315 | .Replace("$safeprojectname$", SafeProjectName)
|
304 | 316 | ;
|
305 | 317 |
|
| 318 | +
|
| 319 | + if(Path.GetExtension(file).ToLower() == ".csproj") |
| 320 | + { |
| 321 | + // Avoid value replacement with msbuild's CodeTaskFactory expansion |
| 322 | + string pattern = string.Format("^{0}\\$if\\$\\(\\${0}\\${0} == True\\)", "(.*?)"); |
| 323 | +
|
| 324 | + s = Regex.Replace(s, pattern, @"$1<!--#if ($2)" + Environment.NewLine + "$1", RegexOptions.Multiline); |
| 325 | +
|
| 326 | + s = s |
| 327 | + .Replace("$endif$", "\n#endif -->"); |
| 328 | + ; |
| 329 | + } |
| 330 | +
|
306 | 331 | if(IsWinUI)
|
307 | 332 | {
|
308 | 333 | if(file.EndsWith("UWP.csproj", StringComparison.OrdinalIgnoreCase))
|
|
0 commit comments