A MSBuild task to allow replacement of a string in a file with another value.
The latest version of the library can be downloaded from the Latest Release Page.
Include the DLL in your MSBuild project
<UsingTask TaskName="TextReplacementTask" AssemblyFile="..\PATH-TO-DLL\RhysG.MSBuild.Common.dll"/>
Then call the TextReplacementTask this takes several parameters described below. To replace all instances of the string $placeholder$ with Replacement Text:
<TextReplacementTask File="..\PATH-TO-FILE\SourceFile.js" OutputFile="..\PATH-TO-FILE\OutputFile.js" StringToReplace="$placeholder$" Value="Replacement Text" />
Parameter | Description |
---|---|
File | The path to the source file |
OutputFile | The path to the output file |
StringToReplace | The text to find in the source file |
Value | The text to replace all occurences of StringToReplace |
This library is released under the FreeBSD License, see LICENSE.txt for more information. Please fork this repository and create a Pull Request for any useful updates/enhancements.
Blog: http://www.rhysgodfrey.co.uk
Twitter: @rhysgodfrey