<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--=============================================================================================-->
<Import Project="$(MSBuildProjectFile).props" />
<!--=============================================================================================-->
<Target Name="BeforeRebuild" DependsOnTargets="_PreBuildAction_" />
<Target Name="AfterBuild" DependsOnTargets="_PostBuildAction_" />
<Target Name="Clean" DependsOnTargets="" />
<!--=============================================================================================-->

<Target Name="_VerifyBuildParameters_">
   <Error Condition=" '$(Platform)' == '' "
          Text="Project property was not specified: &quot;Platform&quot;." />
   <Error Condition=" '$(Configuration)' == '' "
          Text="Project property was not specified: &quot;Configuration&quot;." />
</Target>

<!--=============================================================================================-->

<Target Name="_CleanAll_">
   <RemoveDir
      Directories="@(_CleanAll_Folders_)" />
   <Delete
      Files="@(_CleanAll_Files_)" />
</Target>

<Target Name="_CleanLocal_">
   <RemoveDir
      Directories="@(_CleanLocal_Folders_)" />
   <Delete
      Files="@(_CleanLocal_Files_)" />
</Target>

<Target Name="_CleanPublicDestinationBeforeBuild_">
   <Delete
      Files="@(_CleanPublicDestinationBeforeBuild_Files_)" />
</Target>

<!--=============================================================================================-->

<Target Name="_CopyToOutputFolder_"
        Condition = " '$(_OutputFolder_)' != '' AND
                      '@(_CopyToOutputFolder_Files_)' != '' ">
   <Message
      Text="* Copying files to output folder ..."
      Importance="high" />
   <Copy
      SourceFiles="@(_CopyToOutputFolder_Files_)"
      DestinationFolder="$(_OutputFolder_)" />
</Target>

<Target Name="_CopyToPublicDestination_"
        Condition = " '$(_PublicDestinationFolder_)' != '' AND
                      '@(_CopyToPublicDestination_Files_)' != '' ">
   <Message
      Text="* Copying files to public destination folder ..."
      Importance="high" />
   <Copy
      SourceFiles="@(_CopyToPublicDestination_Files_)"
      DestinationFolder="$(_PublicDestinationFolder_)" />
</Target>

<Target Name="_CopyToPublishFolder_"
        Condition=" '@(_CopyToPublishFolder_Files_)' != '' ">
   <Error
      Condition=" '$(_PublishFolder_)' == '' "
      Text="Project property was not specified: &quot;_PublishFolder_&quot;." />
   <Message
      Text="* Copying files to publish folder ..."
      Importance="high" />
   <Copy
      SourceFiles="@(_CopyToPublishFolder_Files_)"
      DestinationFolder="$(_PublishFolder_)" />
</Target>

<Target
   Name="_CopyFilesToMetaOutputFolder_"
   Condition=" '$(_MetaOutputFolder_)' != '' AND
               '@(_CopyFilesToMetaOutputFolder_Files_)' != '' ">
   <Message
      Text="* Copying files to meta output folder ..."
      Importance="high" />
   <Copy
      SourceFiles='@(_CopyFilesToMetaOutputFolder_Files_)'
      DestinationFolder='$(_MetaOutputFolder_)' />
</Target>

<!--=============================================================================================-->

<Target
   Name="_GenerateFile_PropertiesInfo_CS_"
   Condition=" '$(_OutputFile_PropertiesInfo_CS_)' != '' ">
   <Message
      Text="* Generating file: &quot;$(_OutputFile_PropertiesInfo_CS_)&quot; ..."
      Importance="high" />
   <WriteLinesToFile
      File="$(_OutputFile_PropertiesInfo_CS_)"
      Lines="@(_PropertiesInfo_CS_->'%(Text)')"
      Encoding="UTF-8"
      Overwrite="True" />
</Target>
<!--
<Target
   Name="_GenerateFile_XValues_CS_"
   Condition=" '$(_OutputFile_XValues_CS_)' != '' ">
   <Message
      Text="* Generating file: &quot;$(_OutputFile_XValues_CS_)&quot; ..."
      Importance="high" />
   <WriteLinesToFile
      File="$(_OutputFile_XValues_CS_)"
      Lines="@(_XValues_CS_->'%(Text)')"
      Encoding="UTF-8"
      Overwrite="True" />
</Target>
-->
<!--=============================================================================================-->

<Target
   Name="_PreBuildAction_"
   DependsOnTargets="_VerifyBuildParameters_;_GenerateFiles_;_CleanPublicDestinationBeforeBuild_" />
<Target
   Name="_PostBuildAction_"
   DependsOnTargets="_VerifyBuildParameters_;_CopyToOutputFolder_;_CopyToPublicDestination_" />

<Target
   Name="_GenerateFiles_"
   DependsOnTargets="_GenerateFile_PropertiesInfo_CS_" />

<!--=============================================================================================-->
</Project>
