<?xml version="1.0" encoding="utf-8"?>
<!-- 
  Copyright (c) Microsoft Corporation.
  Licensed under the MIT License.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildThisFileDirectory)\Bundle.Common.targets"/>

  <Target Name="InjectBundleContent" BeforeTargets="PrepareForBuild" AfterTargets="MakeBundle">
    <ItemGroup Condition="'$(UseBundle)' == 'true' and '$(BundleContent)' != '' and '$(BundleContentRoot)' != '' ">
      <BundleContentToBePackaged Include="$(BundleContent)" />
      <None Include="@(BundleContentToBePackaged)">
        <Link>$([MSBuild]::MakeRelative($(ProjectDir),'$(BundleContentRoot)\%(RecursiveDir)%(Filename)%(Extension)'))</Link>
        <DeploymentContent>true</DeploymentContent>
      </None>
   </ItemGroup>
  </Target>

  <ItemDefinitionGroup Condition=" '$(UseBundle)' == 'true' ">
    <ClCompile>
      <PreprocessorDefinitions>BUNDLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>
</Project>