maui-linux/eng/ReplaceText.targets

20 строки
722 B
XML

<Project>
<UsingTask TaskName="ReplaceText"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Input ParameterType="System.String" Required="true" />
<Output ParameterType="System.String" Required="true" />
<OldValue ParameterType="System.String" Required="true" />
<NewValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
File.WriteAllText(Output, File.ReadAllText(Input).Replace(OldValue, NewValue));
]]>
</Code>
</Task>
</UsingTask>
</Project>