Comment Template Replacement

This commit is contained in:
jklingen 2025-01-07 17:41:05 +01:00
commit feb498374a

View file

@ -1,30 +1,31 @@
<Project> <Project>
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"/> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"/>
<!--
<Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"> <Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/> <Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/>
<TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" /> <TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" />
<!-- Read the content of the template --> <!- - Read the content of the template - ->
<ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.template"> <ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.template">
<Output TaskParameter="Lines" ItemName="TemplateLines"/> <Output TaskParameter="Lines" ItemName="TemplateLines"/>
</ReadLinesFromFile> </ReadLinesFromFile>
<!-- Output each line of the file to the log --> <!- - Output each line of the file to the log - ->
<Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.template:" Importance="high"/> <Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.template:" Importance="high"/>
<Message Text="%(TemplateLines.Identity)" Importance="high"/> <Message Text="%(TemplateLines.Identity)" Importance="high"/>
<!-- Read the content of the generated file --> <!- - Read the content of the generated file - ->
<ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.cs"> <ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.cs">
<Output TaskParameter="Lines" ItemName="FileLines"/> <Output TaskParameter="Lines" ItemName="FileLines"/>
</ReadLinesFromFile> </ReadLinesFromFile>
<!-- Output each line of the file to the log --> <!- - Output each line of the file to the log - ->
<Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.cs:" Importance="high"/> <Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.cs:" Importance="high"/>
<Message Text="%(FileLines.Identity)" Importance="high"/> <Message Text="%(FileLines.Identity)" Importance="high"/>
</Target> </Target>
-->
</Project> </Project>