GtkSharp/Source/Workload/Shared/ReplaceText.targets

20 lines
722 B
Text
Raw Permalink Normal View History

<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>