<!--
	Sample demonstrating the ReplaceInFile Task
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 
		 DefaultTargets="PerformReplace">

	<Import Project="$(MSBuildExtensionsPath)\Sedodream\Sedodream.tasks"/>

	<ItemGroup>
		<RedirectFile Include="redirect.html"/>
	</ItemGroup>
	
	<PropertyGroup>
		<IP Condition="$(IP)==''">123.01.02.03</IP>
	</PropertyGroup>
	
	<Target Name="PerformReplace">
		<Message Text="Replace in file starting"/>

		<ReplaceInFile SourceFiles="@(RedirectFile)" Pattern="REDIRECT-URL" 
		 Replacement="http://$(IP)/Default.aspx">
			<Output ItemName="NewFile" TaskParameter="ReplacedFiles"/>
		</ReplaceInFile>

		<Message Text ="Replaced file: @(NewFile)"/>
	</Target>
</Project>

Last edited Jun 26, 2007 at 4:24 AM by sayed_hashimi, version 1

Comments

No comments yet.