common: refactor common library pt2 (#8588)

- remove common lib
- split settings, remove common-md
- move ipc interop/kb_layout to interop
- rename core -> settings, settings -> old_settings
- os-detect header-only; interop -> PowerToysInterop
- split notifications, move single-use headers where they're used
- winstore lib
- rename com utils
- rename Updating and Telemetry projects
- rename core -> settings-ui and remove examples folder
- rename settings-ui folder + consisent common/version include
This commit is contained in:
Andrey Nekrasov
2020-12-15 15:16:09 +03:00
committed by GitHub
parent cddf48547d
commit 212ea2de30
588 changed files with 3304 additions and 3328 deletions

View File

@@ -1,9 +1,10 @@
#include "pch.h"
#include <common/common.h>
#include "http_client.h"
#include "dotnet_installation.h"
#include "http_client.h"
#include "utils/exec.h"
#include "utils/winapi_error.h"
namespace fs = std::filesystem;

View File

@@ -1,18 +1,9 @@
#include "pch.h"
#include "installer.h"
#include "version.h"
#include <common/common.h>
#include <common/notifications.h>
#include <msi.h>
#include <PathCch.h>
#include <winrt/base.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Management.Deployment.h>
#include <common/version/version.h>
#include <common/notifications/notifications.h>
#include "utils/winapi_error.h"
namespace // Strings in this namespace should not be localized
{

View File

@@ -5,7 +5,7 @@
#include <future>
#include "notifications.h"
#include "../VersionHelper.h"
#include <common/version/helper.h>
namespace updating
{

View File

@@ -2,12 +2,12 @@
#include "notifications.h"
#include <common/notifications.h>
#include <common/notifications/notifications.h>
#include "updating.h"
#include "VersionHelper.h"
#include "version.h"
#include <common/version/helper.h>
#include <common/version/version.h>
namespace updating
{

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.200902.2" targetFramework="native" />
</packages>

View File

@@ -15,8 +15,18 @@
#include <ShlObj_core.h>
#include <shellapi.h>
#include <filesystem>
#include <expected.hpp>
#include <msi.h>
#include <PathCch.h>
#include <optional>
#include <expected.hpp>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Networking.Connectivity.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Management.Deployment.h>
#endif //PCH_H

View File

@@ -1,23 +1,15 @@
#include "pch.h"
#include "version.h"
#include <common/version/version.h>
#include <common/version/helper.h>
#include "http_client.h"
#include "notifications.h"
#include "updating.h"
#include <common/common.h>
#include <common/json.h>
#include <common/settings_helpers.h>
#include <common/winstore.h>
#include <common/notifications.h>
#include <winrt/base.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Networking.Connectivity.h>
#include "VersionHelper.h"
#include <common/utils/json.h>
#include <common/SettingsAPI/settings_helpers.h>
#include <common/notifications/notifications.h>
namespace // Strings in this namespace should not be localized
{

View File

@@ -8,7 +8,7 @@
#include <expected.hpp>
#include "notifications.h"
#include "../VersionHelper.h"
#include <common/version/helper.h>
namespace updating
{

View File

@@ -6,7 +6,7 @@
<ProjectGuid>{17DA04DF-E393-4397-9CF0-84DABE11032E}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>updating</RootNamespace>
<ProjectName>updating</ProjectName>
<ProjectName>ApplicationUpdate</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\..\..\deps\expected.props" />
@@ -18,12 +18,6 @@
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -31,7 +25,6 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\;..\..\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -39,10 +32,9 @@
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Lib>
<AdditionalDependencies>Version.lib</AdditionalDependencies>
<AdditionalDependencies>Version.lib;shlwapi.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="dotnet_installation.h" />
<ClInclude Include="http_client.h" />
@@ -50,6 +42,7 @@
<ClInclude Include="notifications.h" />
<ClInclude Include="updating.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="winstore.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dotnet_installation.cpp" />
@@ -62,8 +55,14 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\common.vcxproj">
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
<ProjectReference Include="..\notifications\notifications.vcxproj">
<Project>{1d5be09d-78c0-4fd7-af00-ae7c1af7c525}</Project>
</ProjectReference>
<ProjectReference Include="..\SettingsAPI\SetttingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
<ProjectReference Include="..\version\version.vcxproj">
<Project>{cc6e41ac-8174-4e8a-8d22-85dd7f4851df}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -72,6 +71,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200902.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200902.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -79,5 +79,6 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200902.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200902.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

View File

@@ -33,6 +33,9 @@
<ClInclude Include="installer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="winstore.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">