2021-11-29 19:54:35 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2020-10-06 09:56:59 -07:00
|
|
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
|
|
|
|
|
|
<!-- A note about this project: We're building the test code dll from this
|
|
|
|
|
project, but it _MUST_ be run in conjunction with the TestHostApp project.
|
|
|
|
|
TestHostApp actually will build a TestHost executable and packaging bits
|
|
|
|
|
that we can use to run our tests. We need TestHostApp so that our
|
|
|
|
|
dependencies, like MUX, can be aggregated correctly, and resources properly
|
|
|
|
|
combined into a resources.pri file.
|
|
|
|
|
|
|
|
|
|
TestHostApp will manually copy the output of this project into it's own
|
|
|
|
|
OutDir, so we can run the tests from there. -->
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<ProjectGuid>{CA5CAD1A-9B68-456A-B13E-C8218070DC42}</ProjectGuid>
|
|
|
|
|
<Keyword>Win32Proj</Keyword>
|
|
|
|
|
<RootNamespace>SettingsModelLocalTests</RootNamespace>
|
|
|
|
|
<ProjectName>LocalTests_SettingsModel</ProjectName>
|
|
|
|
|
<TargetName>SettingsModel.LocalTests</TargetName>
|
|
|
|
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
2020-10-27 15:00:41 -07:00
|
|
|
<OpenConsoleCppWinRTProject>true</OpenConsoleCppWinRTProject>
|
2020-10-06 09:56:59 -07:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<Import Project="$(SolutionDir)\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
|
|
|
|
<Import Project="$(OpenConsoleDir)\src\cppwinrt.build.pre.props" />
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Headers ======================== -->
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<ClInclude Include="pch.h" />
|
|
|
|
|
<ClInclude Include="JsonTestClass.h" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Cpp Files ======================== -->
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<ClCompile Include="ProfileTests.cpp" />
|
|
|
|
|
<ClCompile Include="ColorSchemeTests.cpp" />
|
|
|
|
|
<ClCompile Include="KeyBindingsTests.cpp" />
|
|
|
|
|
<ClCompile Include="CommandTests.cpp" />
|
|
|
|
|
<ClCompile Include="DeserializationTests.cpp" />
|
2020-11-16 16:37:19 -08:00
|
|
|
<ClCompile Include="SerializationTests.cpp" />
|
2021-03-15 16:15:25 -07:00
|
|
|
<ClCompile Include="TerminalSettingsTests.cpp" />
|
2020-10-06 09:56:59 -07:00
|
|
|
<ClCompile Include="pch.cpp">
|
|
|
|
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
<!-- You _NEED_ to include this file and the jsoncpp IncludePath (below) if
|
|
|
|
|
you want to use jsoncpp -->
|
|
|
|
|
<ClCompile Include="$(OpenConsoleDir)\dep\jsoncpp\jsoncpp.cpp">
|
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Project References ======================== -->
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\Microsoft.Terminal.Settings.ModelLib.vcxproj" />
|
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\types\lib\types.vcxproj" />
|
2021-04-28 03:43:30 -07:00
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\propslib\propslib.vcxproj" />
|
2020-10-06 09:56:59 -07:00
|
|
|
|
|
|
|
|
<!-- If you don't reference these projects here, the
|
|
|
|
|
_ConsoleGenerateAdditionalWinmdManifests step won't gather the winmd's -->
|
2021-03-17 15:47:24 -05:00
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\dll\TerminalControl.vcxproj" />
|
2020-10-06 09:56:59 -07:00
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- ========================= Globals ======================== -->
|
|
|
|
|
|
|
|
|
|
<!-- ====================== Compiler & Linker Flags ===================== -->
|
|
|
|
|
<ItemDefinitionGroup>
|
|
|
|
|
<ClCompile>
|
|
|
|
|
<AdditionalIncludeDirectories>..;$(OpenConsoleDir)\dep;$(OpenConsoleDir)\dep\jsoncpp\json;$(OpenConsoleDir)src\inc;$(OpenConsoleDir)src\inc\test;$(WinRT_IncludePath)\..\cppwinrt\winrt;"$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\Generated Files";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
|
|
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
2021-12-08 21:00:43 +01:00
|
|
|
<!-- Required for JsonUtils.h. -->
|
|
|
|
|
<AdditionalOptions>%(AdditionalOptions) /Zc:twoPhase-</AdditionalOptions>
|
2020-10-06 09:56:59 -07:00
|
|
|
<!-- Manually disable unreachable code warning, because jconcpp has a ton of that. -->
|
|
|
|
|
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
|
|
|
</ClCompile>
|
|
|
|
|
<Link>
|
|
|
|
|
<AdditionalDependencies>onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
Introduce ActionMap to Terminal Settings Model (#9621)
This entirely removes `KeyMapping` from the settings model, and builds on the work done in #9543 to consolidate all actions (key bindings and commands) into a unified data structure (`ActionMap`).
## References
#9428 - Spec
#6900 - Actions page
Closes #7441
## Detailed Description of the Pull Request / Additional comments
The important thing here is to remember that we're shifting our philosophy of how to interact/represent actions. Prior to this, the actions arrays in the JSON would be deserialized twice: once for key bindings, and again for commands. By thinking of every entry in the relevant JSON as a `Command`, we can remove a lot of the context switching between working with a key binding vs a command palette item.
#9543 allows us to make that shift. Given the work in that PR, we can now deserialize all of the relevant information from each JSON action item. This allows us to simplify `ActionMap::FromJson` to simply iterate over each JSON action item, deserialize it, and add it to our `ActionMap`.
Internally, our `ActionMap` operates as discussed in #9428 by maintaining a `_KeyMap` that points to an action ID, and using that action ID to retrieve the `Command` from the `_ActionMap`. Adding actions to the `ActionMap` automatically accounts for name/key-chord collisions. A `NameMap` can be constructed when requested; this is for the Command Palette.
Querying the `ActionMap` is fairly straightforward. Helper functions were needed to be able to distinguish an explicit unbinding vs the command not being found in the current layer. Internally, we store explicitly unbound names/key-chords as `ShortcutAction::Invalid` commands. However, we return `nullptr` when a query points to an unbound command. This is done to hide this complexity away from any caller.
The command palette still needs special handling for nested and iterable commands. Thankfully, the expansion of iterable commands is performed on an `IMapView`, so we can just expose `NameMap` as a consolidation of `ActionMap`'s `NameMap` with its parents. The same can be said for exposing key chords in nested commands.
## Validation Steps Performed
All local tests pass.
2021-05-04 21:50:13 -07:00
|
|
|
<!--
|
|
|
|
|
SettingsModelLib contains a DllMain that we need to force the use of.
|
|
|
|
|
If you don't have this, then you'll see an error like
|
|
|
|
|
"(init.obj) : error LNK2005: DllMain already defined in MSVCRTD.lib(dll_dllmain_stub.obj)"
|
|
|
|
|
-->
|
build: ship a Win11 build of Terminal that's <=half the size (#12560)
Four (4) squashed changes, with messages preserved.
## release: move symbol publication into its own phase
Right now, symbol publication happens every time we produce a final
bundle. In the future, we may be producing multiple bundles from the
same pipeline run, and we need to make sure we only do *one* symbol
publication to MSDL.
When we do that, it will be advantageous for us to have just one phase
that source-indexes and publishes all of the symbols.
## Remove Terminal's built-in copy of the VC Runtime
This removes the trick we pulled in #5661 and saves us ~550kb per arch.
Some of our dependencies still depend on the "app" versions of the
runtime libraries, so we are going to continue shipping the forwarders
in our package. Build rules have been updated to remove the non-Desktop
VCLibs dependency to slim down our package graph.
This is not a problem on Windows 11 -- it looks like it's shipped inbox.
**BREAKING CHANGE**: When launched unpackaged, Terminal now requires the
vcruntime redist to be installed.
## Prepare for toggling XAML between 2.7.0 and -prerelease on Win11
common.openconsole.props is a pretty good place to stash the XAML
version since it is included in every project (including the WAP
project (unlike the C++ build props!)).
I've gone ahead and added a "double dependency" on multiple XAML
versions. We'll toggle them with a build flag.
## Run the release pipeline twice, for Win10 and Win11, at the same time
This required some changes in how we download artifacts to make sure
that we could control which version of Windows we were processing in any
individual step.
We're also going to patch the package manifest on the Windows 11 version
so the store targets it more specifically.
On top of the prior three steps, this lets us ship a Windows 11
package that costs only ~15MB on disk. The Windows 10 version, for
comparison, is about 40.
2022-02-24 18:09:28 -06:00
|
|
|
<AdditionalOptions Condition="'$(Platform)'=='Win32'">%(AdditionalOptions) /INCLUDE:_DllMain@12</AdditionalOptions>
|
|
|
|
|
<AdditionalOptions Condition="'$(Platform)'!='Win32'">%(AdditionalOptions) /INCLUDE:DllMain</AdditionalOptions>
|
2020-10-06 09:56:59 -07:00
|
|
|
</Link>
|
|
|
|
|
</ItemDefinitionGroup>
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<GenerateManifest>true</GenerateManifest>
|
|
|
|
|
<EmbedManifest>true</EmbedManifest>
|
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
|
|
|
|
|
<Import Project="$(OpenConsoleDir)src\common.build.post.props" />
|
|
|
|
|
<Import Project="$(OpenConsoleDir)src\common.build.tests.props" />
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<!-- From Microsoft.UI.Xaml.targets -->
|
|
|
|
|
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
|
|
|
|
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
build: ship a Win11 build of Terminal that's <=half the size (#12560)
Four (4) squashed changes, with messages preserved.
## release: move symbol publication into its own phase
Right now, symbol publication happens every time we produce a final
bundle. In the future, we may be producing multiple bundles from the
same pipeline run, and we need to make sure we only do *one* symbol
publication to MSDL.
When we do that, it will be advantageous for us to have just one phase
that source-indexes and publishes all of the symbols.
## Remove Terminal's built-in copy of the VC Runtime
This removes the trick we pulled in #5661 and saves us ~550kb per arch.
Some of our dependencies still depend on the "app" versions of the
runtime libraries, so we are going to continue shipping the forwarders
in our package. Build rules have been updated to remove the non-Desktop
VCLibs dependency to slim down our package graph.
This is not a problem on Windows 11 -- it looks like it's shipped inbox.
**BREAKING CHANGE**: When launched unpackaged, Terminal now requires the
vcruntime redist to be installed.
## Prepare for toggling XAML between 2.7.0 and -prerelease on Win11
common.openconsole.props is a pretty good place to stash the XAML
version since it is included in every project (including the WAP
project (unlike the C++ build props!)).
I've gone ahead and added a "double dependency" on multiple XAML
versions. We'll toggle them with a build flag.
## Run the release pipeline twice, for Win10 and Win11, at the same time
This required some changes in how we download artifacts to make sure
that we could control which version of Windows we were processing in any
individual step.
We're also going to patch the package manifest on the Windows 11 version
so the store targets it more specifically.
On top of the prior three steps, this lets us ship a Windows 11
package that costs only ~15MB on disk. The Windows 10 version, for
comparison, is about 40.
2022-02-24 18:09:28 -06:00
|
|
|
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
2020-10-06 09:56:59 -07:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<!-- We actually can just straight up reference MUX here, it's fine -->
|
build: ship a Win11 build of Terminal that's <=half the size (#12560)
Four (4) squashed changes, with messages preserved.
## release: move symbol publication into its own phase
Right now, symbol publication happens every time we produce a final
bundle. In the future, we may be producing multiple bundles from the
same pipeline run, and we need to make sure we only do *one* symbol
publication to MSDL.
When we do that, it will be advantageous for us to have just one phase
that source-indexes and publishes all of the symbols.
## Remove Terminal's built-in copy of the VC Runtime
This removes the trick we pulled in #5661 and saves us ~550kb per arch.
Some of our dependencies still depend on the "app" versions of the
runtime libraries, so we are going to continue shipping the forwarders
in our package. Build rules have been updated to remove the non-Desktop
VCLibs dependency to slim down our package graph.
This is not a problem on Windows 11 -- it looks like it's shipped inbox.
**BREAKING CHANGE**: When launched unpackaged, Terminal now requires the
vcruntime redist to be installed.
## Prepare for toggling XAML between 2.7.0 and -prerelease on Win11
common.openconsole.props is a pretty good place to stash the XAML
version since it is included in every project (including the WAP
project (unlike the C++ build props!)).
I've gone ahead and added a "double dependency" on multiple XAML
versions. We'll toggle them with a build flag.
## Run the release pipeline twice, for Win10 and Win11, at the same time
This required some changes in how we download artifacts to make sure
that we could control which version of Windows we were processing in any
individual step.
We're also going to patch the package manifest on the Windows 11 version
so the store targets it more specifically.
On top of the prior three steps, this lets us ship a Windows 11
package that costs only ~15MB on disk. The Windows 10 version, for
comparison, is about 40.
2022-02-24 18:09:28 -06:00
|
|
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.$(TerminalMUXVersion)\build\native\Microsoft.UI.Xaml.targets')" />
|
2020-10-06 09:56:59 -07:00
|
|
|
|
|
|
|
|
</Project>
|