<Project DefaultTargets="TransformConfigs" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectPath>.\</ProjectPath>
    <SourceDirectory>.\OurUmbraco.Site\</SourceDirectory>
	<ProjectName>OurUmbraco</ProjectName>
	<Environment>Live</Environment>
    <DestinationDirectory>C:\inetpub\wwwroot\$(Environment)\$(ProjectName)\</DestinationDirectory>
	<DeployHelperDirectory>$(ProjectPath)..\..\Deploy\</DeployHelperDirectory>
  </PropertyGroup>

  <UsingTask TaskName="TransformXml" AssemblyFile="$(DeployHelperDirectory)Microsoft.Web.Publishing.Tasks.dll"/>

  <Target Name="TransformConfigs">
    <PropertyGroup>
      <WebConfigTransformInputFile>$(SourceDirectory)web.config</WebConfigTransformInputFile>
      <WebConfigTransformFile>$(DeployHelperDirectory)\$(ProjectName)\ConfigTransforms\Web.$(Environment).config</WebConfigTransformFile>
      <ConfigTransformOutputFolder>$(DeployHelperDirectory)\$(ProjectName)\$(Environment)\</ConfigTransformOutputFolder>
      <StackTraceEnabled>False</StackTraceEnabled>
    </PropertyGroup>

    <MakeDir Directories="$(ConfigTransformOutputFolder)"/>

    <TransformXml Source="$(WebConfigTransformInputFile)"
                  Transform="$(WebConfigTransformFile)"
                  Destination="$(ConfigTransformOutputFolder)\Web.config"
                  StackTrace="$(StackTraceEnabled)" />
  </Target>
</Project>