<?xml version="1.0" encoding="utf-8"?>
<!-- 
  Copyright (c) Microsoft Corporation.
  Licensed under the MIT License.

  This file will be consumed by ALL UWP C++ app projects (both inside
  and outside of this repo) that build on top of Microsoft.ReactNative.
  Do not make any changes here unless it applies to ALL such projects.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Condition="'$(UseExperimentalNuget)' == 'false'" Label="Shared">
    <Import Project="$(ReactNativeWindowsDir)\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" 
            Label="Shared" />
  </ImportGroup>
  <ItemGroup Condition="'$(UseExperimentalNuget)' == 'false'">
    <ProjectReference Include="$(ReactNativeWindowsDir)\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj">
      <Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
    </ProjectReference>
  </ItemGroup>

  <!-- The props file for bundling is not set up to be just defaults, it assumes to be run at the end of the project. -->
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.props" />
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.Cpp.targets"/>

  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Autolink.targets" />
  <Import Project="$(ProjectDir)\AutolinkedNativeModules.g.targets"
          Condition="Exists('$(ProjectDir)\AutolinkedNativeModules.g.targets')" />

  <Import Project="$(OutputPath)$(AssemblyName).Build.appxrecipe"
          Condition="Exists('$(OutputPath)$(AssemblyName).Build.appxrecipe') And '$(DeployLayout)'=='true'" />

  <Target Name="Deploy" Condition="'$(DeployLayout)'=='true'">
    <Error Condition="!Exists('$(OutputPath)$(AssemblyName).Build.appxrecipe')"
           Text="You must first build the project before deploying it" />
    <Copy SourceFiles="%(AppxPackagedFile.Identity)"
          DestinationFiles="$(OutputPath)Appx\%(AppxPackagedFile.PackagePath)" />
    <Copy SourceFiles="%(AppXManifest.Identity)"
          DestinationFiles="$(OutputPath)Appx\%(AppxManifest.PackagePath)"
          Condition="'%(AppxManifest.SubType)'!='Designer'"/>
    <Exec Command="powershell -NonInteractive -NoProfile -Command Add-AppxPackage -Register $(OutputPath)Appx\AppxManifest.xml"
          ContinueOnError="false" />
  </Target>

  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\CppAppConsumeCSharpModule.targets" />

  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\RequireSolution.targets" />
</Project>
