I have the following in my .csproj
:
<ItemGroup>
<Content Include="Main.qml" CopyToPublishDirectory="Always" />
</ItemGroup>
I need to find & replace some text in Main.qml
on the copy in the published directory. Is this possible?
I have the following in my .csproj
:
<ItemGroup>
<Content Include="Main.qml" CopyToPublishDirectory="Always" />
</ItemGroup>
I need to find & replace some text in Main.qml
on the copy in the published directory. Is this possible?
The MSBuild Extension Pack has a File
class that accepts a TaskAction
of Replace
. This action can perform a Regex replace.
You would use it something like this:
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="input*" Replacement="repl" Path="C:\$(ProjectDir)\$(PublishDir)\Main.qml"/>
<postBuild>
<Exec command="cmd command to find and replace on file:$(OutputPath)\Main.qml"/>
</PostBuild>