terminal/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj
Mike Griese 8ba8f35dc5
Add Cascading User + Default Settings (#2515)
This PR represents the start of the work on Cascading User + default settings, #754.

Cascading settings will be done in two parts: 
* [ ] Layered Default+User settings (this PR)
* [ ] Dynamic Profile Generation (#2603).

Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master.

This PR covers adding one primary feature: the settings are now in two separate files:
* a static `defaults.json` that ships with the package (the "default settings")
* a `profiles.json` with the user's customizations (the "user settings)

User settings are _layered_ upon the settings in the defaults settings.

## References

Other things that might be related here:
* #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state 
* #1398 - This might have honestly been solved by #2475 

## PR Checklist
* [x] Closes #754
* [x] Closes #1378 
* [x] Closes #2566
* [x] I work here
* [x] Tests added/passed
* [x] Requires documentation to be updated - it **ABSOLUTELY DOES**


## Detailed Description of the Pull Request / Additional comments

1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 
2. Next, we add tests for layering properties like that.
3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings.
4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk.
5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values.
6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is.
7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything.
8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles.

## TODO:
* [x] Still need to make Alt+Click work on the settings button
* [x] Need to write some user documentation on how the new settings model works
* [x] Fix the pair of tests I broke (re: Duplicate profiles)


<hr>

* Create profiles by layering them

* Update test to layer multiple times on the same profile

* Add support for layering an array of profiles, but break a couple tests

* Add a defaults.json to the package

* Layer colorschemes

  * Moves tests into individual classes
  * adds support for layering a colorscheme on top of another

* Layer an array of color schemes

* oh no, this was missed with #2481

  must have committed without staging this change, uh oh. Not like those tests actually work so nbd

* Layer keybindings

* Read settings from defaults.json + profiles.json, layer appropriately

  This is like 80% of #754. Needs tests.

* Add tests for keybindings

  * add support to unbind a key with `null` or `"unbound"` or `"garbage"`

* Layer or clear optional properties

* Add a helper to get an optional variable for a bunch of different types

  In the end, I think we need to ask _was this worth it_

* Do this with the stretch mode too

* Add back in the GUID check for profiles

* Add some tests for global settings layering

* M A D  W I T H  P O W E R

  Add a MsBuild target to auto-generate a header with the defaults.json as a
  string in the file. That way, we can _always_ load the defaults. Literally impossible to not.

* When the user's profile.json doesn't exist, create it from a template

* Re-order profiles to match the order set in the user's profiles.json

* Add tests for re-ordering profiles to match user ordering

* Add support for hiding profiles using `"hidden": true`

* Use the hardcoded defaults.json for the exception->"use defaults" case

* Somehow I messed up the git submodules?

* woo documentation

* Fix a Terminal.App.Unit.Tests failure

* signed/unsigned is hard

* Use Alt+Settings button to open the default settings

* Missed a signed/unsigned

* Some very preliminary PR feedback

* More PR feedback

  Use the wil helper for the exe path
  Move jsonutils into their own file
  kill some dead code

* Add templates to these bois

* remove some code for generating defaults, reorder defaults.json a tad

* Make guid a std::optional

* Large block of PR feedback

  * Remove some dead code
  * add some comments
  * tag some todos

* stl is love, stl is life

* add `-noprofile`

* Fix the crash that dustin found

* -Encoding ASCII

* Set a profile's default scheme to Campbell

* Fix the tests I regressed

* Update UsingJsonSetting.md to reflect that changes from these PRs

* Change how GenerateGuidForProfile works

* Make AppKeyBindings do its own serialization

* Remove leftover dead code from the previous commit

* Fix up an enormous number of PR nits

* Fix a typo; Update the defaults to match #2378

* Tiny nits

* Some typos, PR nits

* Fix this broken defaults case
2019-09-16 12:57:10 -07:00

339 lines
18 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
<Import Project="$(OpenConsoleDir)src\wap-common.build.pre.props" />
<PropertyGroup Label="Version">
<!-- These fields are picked up by PackageES -->
<VersionMajor>0</VersionMajor>
<VersionMinor>4</VersionMinor>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<!--
These two properties are very important!
Without them, msbuild will stomp MinVersion and MaxVersionTested in the
Package.appxmanifest and replace them with whatever our values for
TargetPlatformMinVersion and TargetPlatformVersion are.
-->
<AppxOSMinVersionReplaceManifestVersion>false</AppxOSMinVersionReplaceManifestVersion>
<AppxOSMaxVersionTestedReplaceManifestVersion>false</AppxOSMaxVersionTestedReplaceManifestVersion>
</PropertyGroup>
<PropertyGroup>
<ProjectGuid>CA5CAD1A-224A-4171-B13A-F16E576FDD12</ProjectGuid>
<EntryPointProjectUniqueName>..\WindowsTerminal\WindowsTerminal.vcxproj</EntryPointProjectUniqueName>
<DebuggerType>NativeOnly</DebuggerType>
</PropertyGroup>
<PropertyGroup Condition="!Exists('CascadiaPackage_TemporaryKey.pfx')">
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="Exists('CascadiaPackage_TemporaryKey.pfx')">
<AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<PackageCertificateKeyFile>CascadiaPackage_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<ItemGroup Condition="Exists('CascadiaPackage_TemporaryKey.pfx')">
<None Include="CascadiaPackage_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" Condition="'$(WindowsTerminalReleaseBuild)'=='true'">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package-Dev.appxmanifest" Condition="'$(WindowsTerminalReleaseBuild)'!='true'">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="$(OpenConsoleDir)res\terminal\LargeTile.scale-100.png">
<Link>Images\LargeTile.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LargeTile.scale-125.png">
<Link>Images\LargeTile.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LargeTile.scale-150.png">
<Link>Images\LargeTile.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LargeTile.scale-200.png">
<Link>Images\LargeTile.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LargeTile.scale-400.png">
<Link>Images\LargeTile.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LockScreenLogo.scale-100.png">
<Link>Images\LockScreenLogo.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LockScreenLogo.scale-125.png">
<Link>Images\LockScreenLogo.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LockScreenLogo.scale-150.png">
<Link>Images\LockScreenLogo.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LockScreenLogo.scale-200.png">
<Link>Images\LockScreenLogo.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\LockScreenLogo.scale-400.png">
<Link>Images\LockScreenLogo.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SmallTile.scale-100.png">
<Link>Images\SmallTile.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SmallTile.scale-125.png">
<Link>Images\SmallTile.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SmallTile.scale-150.png">
<Link>Images\SmallTile.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SmallTile.scale-200.png">
<Link>Images\SmallTile.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SmallTile.scale-400.png">
<Link>Images\SmallTile.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SplashScreen.scale-100.png">
<Link>Images\SplashScreen.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SplashScreen.scale-125.png">
<Link>Images\SplashScreen.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SplashScreen.scale-150.png">
<Link>Images\SplashScreen.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SplashScreen.scale-200.png">
<Link>Images\SplashScreen.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\SplashScreen.scale-400.png">
<Link>Images\SplashScreen.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square150x150Logo.scale-100.png">
<Link>Images\Square150x150Logo.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square150x150Logo.scale-125.png">
<Link>Images\Square150x150Logo.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square150x150Logo.scale-150.png">
<Link>Images\Square150x150Logo.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square150x150Logo.scale-200.png">
<Link>Images\Square150x150Logo.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square150x150Logo.scale-400.png">
<Link>Images\Square150x150Logo.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.scale-100.png">
<Link>Images\Square44x44Logo.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.scale-125.png">
<Link>Images\Square44x44Logo.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.scale-150.png">
<Link>Images\Square44x44Logo.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.scale-200.png">
<Link>Images\Square44x44Logo.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.scale-400.png">
<Link>Images\Square44x44Logo.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-16.png">
<Link>Images\Square44x44Logo.targetsize-16.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-16_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-16_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-20.png">
<Link>Images\Square44x44Logo.targetsize-20.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-20_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-20_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-24.png">
<Link>Images\Square44x44Logo.targetsize-24.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-24_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-24_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-256.png">
<Link>Images\Square44x44Logo.targetsize-256.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-256_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-256_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-30.png">
<Link>Images\Square44x44Logo.targetsize-30.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-30_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-30_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-32.png">
<Link>Images\Square44x44Logo.targetsize-32.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-32_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-32_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-36.png">
<Link>Images\Square44x44Logo.targetsize-36.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-36_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-36_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-40.png">
<Link>Images\Square44x44Logo.targetsize-40.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-40_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-40_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-48.png">
<Link>Images\Square44x44Logo.targetsize-48.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-48_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-48_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-60.png">
<Link>Images\Square44x44Logo.targetsize-60.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-60_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-60_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-64.png">
<Link>Images\Square44x44Logo.targetsize-64.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-64_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-64_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-72.png">
<Link>Images\Square44x44Logo.targetsize-72.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-72_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-72_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-80.png">
<Link>Images\Square44x44Logo.targetsize-80.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-80_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-80_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-96.png">
<Link>Images\Square44x44Logo.targetsize-96.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Square44x44Logo.targetsize-96_altform-unplated.png">
<Link>Images\Square44x44Logo.targetsize-96_altform-unplated.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\StoreLogo.scale-100.png">
<Link>Images\StoreLogo.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\StoreLogo.scale-125.png">
<Link>Images\StoreLogo.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\StoreLogo.scale-150.png">
<Link>Images\StoreLogo.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\StoreLogo.scale-200.png">
<Link>Images\StoreLogo.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\StoreLogo.scale-400.png">
<Link>Images\StoreLogo.scale-400.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Wide310x150Logo.scale-100.png">
<Link>Images\Wide310x150Logo.scale-100.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Wide310x150Logo.scale-125.png">
<Link>Images\Wide310x150Logo.scale-125.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Wide310x150Logo.scale-150.png">
<Link>Images\Wide310x150Logo.scale-150.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Wide310x150Logo.scale-200.png">
<Link>Images\Wide310x150Logo.scale-200.png</Link>
</Content>
<Content Include="$(OpenConsoleDir)res\terminal\Wide310x150Logo.scale-400.png">
<Link>Images\Wide310x150Logo.scale-400.png</Link>
</Content>
<!-- Profile Icons -->
<Content Include="ProfileIcons\{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.scale-100.png" />
<Content Include="ProfileIcons\{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.scale-200.png" />
<Content Include="ProfileIcons\{574e775e-4f2a-5b96-ac1e-a2962a402336}.scale-100.png" />
<Content Include="ProfileIcons\{574e775e-4f2a-5b96-ac1e-a2962a402336}.scale-200.png" />
<Content Include="ProfileIcons\{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.scale-100.png" />
<Content Include="ProfileIcons\{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.scale-200.png" />
<Content Include="ProfileIcons\{9acb9455-ca41-5af7-950f-6bca1bc9722f}.scale-100.png" />
<Content Include="ProfileIcons\{9acb9455-ca41-5af7-950f-6bca1bc9722f}.scale-200.png" />
<Content Include="ProfileIcons\{b453ae62-4e3d-5e58-b989-0a998ec441b8}.scale-100.png" />
<Content Include="ProfileIcons\{b453ae62-4e3d-5e58-b989-0a998ec441b8}.scale-200.png" />
<!-- Default Settings -->
<Content Include="$(OpenConsoleDir)src\cascadia\TerminalApp\defaults.json">
<Link>defaults.json</Link>
</Content>
<!-- Resources -->
<PRIResource Include="Resources\en-US\Resources.resw" />
</ItemGroup>
<Import Project="$(OpenConsoleDir)src\wap-common.build.post.props" />
<ItemGroup>
<ProjectReference Include="..\WindowsTerminal\WindowsTerminal.vcxproj" />
<ProjectReference Include="..\..\host\exe\Host.EXE.vcxproj" />
</ItemGroup>
<!-- Stomp the path to conhost.exe.
This task will copy OpenConsole.exe to the appx as conhost.exe, and place it
adjacent to WindowsTerminal.exe.
-->
<Target Name="OpenConsoleStompSourceProjectForWapProject" BeforeTargets="_ConvertItems">
<ItemGroup>
<!-- Stomp all "SourceProject" values for all incoming dependencies to flatten the package. -->
<_TemporaryFilteredWapProjOutput Include="@(_FilteredNonWapProjProjectOutput)" />
<_FilteredNonWapProjProjectOutput Remove="@(_TemporaryFilteredWapProjOutput)" />
<_FilteredNonWapProjProjectOutput Include="@(_TemporaryFilteredWapProjOutput)">
<!-- Override the filename for OpenConsole.exe (only) -->
<TargetPath Condition="'%(Filename)' == 'OpenConsole' and '%(Extension)' == '.exe'">conhost.exe</TargetPath>
<!-- Blank the SourceProject here to vend all files into the root of the package. -->
<SourceProject>
</SourceProject>
</_FilteredNonWapProjProjectOutput>
</ItemGroup>
</Target>
<!-- Move all the PRI files that would be packaged into the appx into _PriFile so that
GenerateProjectPriFile catches them. This requires us to move payload collection
up before GenerateProjectPriFile, when it is typically _after_ it (because the
DesktopBridge project type is built to only prepare the payload during appx manifest
generation.
Since PRI file generation is _before_ manifest generation (for possibly obvious or
important reasons), that doesn't work for us.
-->
<PropertyGroup>
<!-- Only for MSBuild versions < 16.3.0 -->
<_GenerateProjectPriFileDependsOn Condition="$(MSBuildVersion) &lt; '16.3.0'">OpenConsoleLiftDesktopBridgePriFiles;$(_GenerateProjectPriFileDependsOn)</_GenerateProjectPriFileDependsOn>
</PropertyGroup>
<Target Name="OpenConsoleLiftDesktopBridgePriFiles" DependsOnTargets="_ConvertItems">
<ItemGroup>
<_PriFile Include="@(_NonWapProjProjectOutput)" Condition="'%(Extension)' == '.pri'" />
<!-- Remove all other .pri files from the appx payload. -->
<AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(Extension)' == '.pri'" />
</ItemGroup>
</Target>
<!-- VS 16.3.0 added a rule to the WAP packaging project that removes all non-WAP payload, which we were relying on to
roll up our subproject resources. We have to suppress that rule but keep part of its logic, because that rule is
where the AppxPackagePayload items are created. -->
<PropertyGroup>
<!-- Only for MSBuild versions <= 16.4.0 -->
<!-- TODO: Change this to hard less than once the 16.4.0 previews fix the bug. -->
<WapProjBeforeGenerateAppxManifestDependsOn
Condition="$(MSBuildVersion) &lt;= '16.4.0'">
$([MSBuild]::Unescape('$(WapProjBeforeGenerateAppxManifestDependsOn.Replace('_RemoveAllNonWapUWPItems', '_OpenConsoleRemoveAllNonWapUWPItems'))'))
</WapProjBeforeGenerateAppxManifestDependsOn>
</PropertyGroup>
<Target Name="_OpenConsoleRemoveAllNonWapUWPItems">
<ItemGroup>
<AppxPackagePayload Include="@(WapProjPackageFile)" />
<AppxUploadPackagePayload Include="@(UploadWapProjPackageFile)" />
<!-- 16.3.0 - remove non-resources.pri PRI files since we just forced them back in. -->
<AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(Extension)' == '.pri' and '%(Filename)' != 'resources'" />
<AppxUploadPackagePayload Remove="@(AppxUploadPackagePayload)" Condition="'%(Extension)' == '.pri' and '%(Filename)' != 'resources'" />
</ItemGroup>
</Target>
</Project>