|
13 | 13 | </PropertyGroup>
|
14 | 14 | <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" />
|
15 | 15 | <PropertyGroup>
|
| 16 | + <!-- |
| 17 | + `AppxManifest.xml` is output relative to the `.wapproj` file and |
| 18 | + `run-windows` cannot find it because it expects `.wapproj` to be in the |
| 19 | + same directory as the solution. We need to change the output directory so |
| 20 | + that `run-windows` can find the file. |
| 21 | +
|
| 22 | + Note that we don't use `OutDir` because the project name is always |
| 23 | + appended to it, e.g. `x64/Debug/ReactApp.Package`. |
| 24 | + --> |
| 25 | + <BaseOutputPath>$([MSBuild]::MakeRelative($(MSBuildThisFileDirectory), $(SolutionDir)))\$(MSBuildProjectName)\bin\</BaseOutputPath> |
| 26 | + <OutputPath>$(BaseOutputPath)\$(Platform)\$(Configuration)\</OutputPath> |
16 | 27 | <WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
|
17 | 28 | </PropertyGroup>
|
18 | 29 | <Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
|
|
88 | 99 | <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props'))" />
|
89 | 100 | <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets'))" />
|
90 | 101 | </Target>
|
| 102 | + <Target Name="CopyAppPackagesToOutputDirectory" AfterTargets="_GenerateAppxPackage"> |
| 103 | + <!-- |
| 104 | + `AppPackages` is output relative to the `.wapproj` file and `run-windows` |
| 105 | + cannot find it because it expects `.wapproj` to be in the same directory |
| 106 | + as the solution. We need to copy the files to the output directory so that |
| 107 | + `run-windows` can find them. |
| 108 | + --> |
| 109 | + <ItemGroup> |
| 110 | + <AppPackagesFiles Include="$(MSBuildThisFileDirectory)\AppPackages\**\*.*"/> |
| 111 | + </ItemGroup> |
| 112 | + <Copy |
| 113 | + SourceFiles="@(AppPackagesFiles)" |
| 114 | + DestinationFolder="$(BaseOutputPath)\..\AppPackages\%(RecursiveDir)" |
| 115 | + UseSymbolicLinksIfPossible="true" |
| 116 | + /> |
| 117 | + </Target> |
91 | 118 | </Project>
|
0 commit comments