Fix compact build for Win 10 Mail / Outlook

This commit is contained in:
Max Golovanov 2020-05-19 19:24:09 -07:00
Родитель 64c5f633b8
Коммит fb4747cbf7
13 изменённых файлов: 128 добавлений и 17 удалений

Просмотреть файл

@ -190,6 +190,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\system\TelemetrySystemBase.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\tpm\DeviceStateHandler.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\tpm\TransmissionPolicyManager.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\tpm\TransmitProfilesStub.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\utils\FileUtils.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\utils\StringConversion.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\utils\StringUtils.hpp" />

Просмотреть файл

@ -617,6 +617,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\utils\StringConversion.hpp">
<Filter>utils</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\tpm\TransmitProfilesStub.hpp">
<Filter>tpm</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\Version.hpp.template">

Просмотреть файл

@ -12,4 +12,5 @@
<OutputPath>$(OutDir)</OutputPath>
<TargetPath>$(OutDir)$(TargetName)$(TargetExt)</TargetPath>
</PropertyGroup>
<Import Condition="Exists('$(CUSTOM_PROPS_VS)')" Project="$(CUSTOM_PROPS_VS)" />
</Project>

Просмотреть файл

@ -3,13 +3,15 @@ cd %~dp0
call tools\gen-version.cmd
@setlocal ENABLEEXTENSIONS
echo Update all public submodules...
git -c submodule."lib/modules".update=none submodule update --init --recursive
if DEFINED GIT_PULL_TOKEN (
rd /s /q lib\modules
git clone https://%GIT_PULL_TOKEN%:x-oauth-basic@github.com/microsoft/cpp_client_telemetry_modules.git lib\modules
)
echo "Building using Visual Studio 2017 tools"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
call tools\vcvars.cmd
set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS%
set platform=
@ -35,12 +37,12 @@ msbuild %SOLUTION% /target:sqlite,zlib,win32-lib /p:BuildProjectReferences=true
msbuild %SOLUTION% /target:sqlite,zlib,win32-lib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release.vs2015.MT-sqlite /p:Platform=x64 %CUSTOM_PROPS%
REM ARM DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm
call tools\vcvars-ext.cmd arm
msbuild %SOLUTION% /target:zlib,sqlite-uwp,win10-cs,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM %CUSTOM_PROPS%
msbuild %SOLUTION% /target:zlib,sqlite-uwp,win10-cs,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM %CUSTOM_PROPS%
REM ARM64 DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm64
call tools\vcvars-ext.cmd arm64
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp,win32-dll,win32-lib,win10-cs,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM64 %CUSTOM_PROPS%
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp,win32-dll,win32-lib,win10-cs,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM64 %CUSTOM_PROPS%

Просмотреть файл

@ -8,8 +8,15 @@ REM
call tools\gen-version.cmd
@setlocal ENABLEEXTENSIONS
echo "Building using Visual Studio 2017 tools"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
echo Update all public submodules...
git -c submodule."lib/modules".update=none submodule update --init --recursive
if DEFINED GIT_PULL_TOKEN (
rd /s /q lib\modules
git clone https://%GIT_PULL_TOKEN%:x-oauth-basic@github.com/microsoft/cpp_client_telemetry_modules.git lib\modules
)
call tools\vcvars.cmd
set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS%
set platform=
@ -28,12 +35,12 @@ msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpu
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=x64 %CUSTOM_PROPS%
REM ARM DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm
call tools\vcvars-ext.cmd arm
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM %CUSTOM_PROPS%
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM %CUSTOM_PROPS%
REM ARM64 DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm64
call tools\vcvars-ext.cmd arm64
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM64 %CUSTOM_PROPS%
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM64 %CUSTOM_PROPS%

Просмотреть файл

@ -8,8 +8,15 @@ REM
call tools\gen-version.cmd
@setlocal ENABLEEXTENSIONS
echo "Building using Visual Studio 2017 tools"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
echo Update all public submodules...
git -c submodule."lib/modules".update=none submodule update --init --recursive
if DEFINED GIT_PULL_TOKEN (
rd /s /q lib\modules
git clone https://%GIT_PULL_TOKEN%:x-oauth-basic@github.com/microsoft/cpp_client_telemetry_modules.git lib\modules
)
call tools\vcvars.cmd
set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS%
set platform=
@ -28,12 +35,12 @@ msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpu
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=x64 %CUSTOM_PROPS%
REM ARM DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm
call tools\vcvars-ext.cmd arm
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM %CUSTOM_PROPS%
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM %CUSTOM_PROPS%
REM ARM64 DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm64
call tools\vcvars-ext.cmd arm64
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM64 %CUSTOM_PROPS%
msbuild %SOLUTION% /target:zlib,win10-dll /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM64 %CUSTOM_PROPS%

Просмотреть файл

@ -56,3 +56,21 @@ How it works:
```
That file is included from **mat/config.h** and propagates the necessary configuration flags to all SDK modules.
## Building custom SDK SKU in Visual Studio
In order to test your custom build configuration in Visual Studio IDE:
1. set CUSTOM_PROPS_VS variable in cmd.exe . For example:
```
set "CUSTOM_PROPS_VS=%~dp0\Solutions\build.compact-min.props"
```
2. Launch Visual Studio IDE (devenv.exe) from that same shell:
```
tools\start-ide.cmd
```
3. Perform selective **Batch build...** of applicable projects. Some projects in solution may not be custom build-friendly. Build only the projects you need.

Просмотреть файл

@ -3,8 +3,8 @@
#define MAT_VERSION_HPP
// WARNING: DO NOT MODIFY THIS FILE!
// This file has been automatically generated, manual changes will be lost.
#define BUILD_VERSION_STR "3.3.88.1"
#define BUILD_VERSION 3,3,88,1
#define BUILD_VERSION_STR "3.3.140.1"
#define BUILD_VERSION 3,3,140,1
#ifndef RESOURCE_COMPILER_INVOKED
#include <stdint.h>
@ -30,7 +30,7 @@ namespace ARIASDK_NS_BEGIN {
uint64_t const Version =
((uint64_t)3 << 48) |
((uint64_t)3 << 32) |
((uint64_t)88 << 16) |
((uint64_t)140 << 16) |
((uint64_t)1);
} ARIASDK_NS_END

Просмотреть файл

@ -5,6 +5,10 @@
namespace ARIASDK_NS_BEGIN {
TransmitProfiles::TransmitProfiles() {};
TransmitProfiles::~TransmitProfiles() {};
bool TransmitProfiles::load(const std::string&) { return false; };
bool TransmitProfiles::load(const std::vector<TransmitProfileRules>&) noexcept { return false; };
@ -19,9 +23,11 @@ namespace ARIASDK_NS_BEGIN {
bool TransmitProfiles::updateStates(NetworkCost, PowerSource) { return true; };
void TransmitProfiles::getTimers(std::vector<int>& out)
void TransmitProfiles::getTimers(TimerArray& out)
{
out = { 1, 2, 4 };
out[0] = 1;
out[1] = 2;
out[2] = 4;
}
bool TransmitProfiles::isTimerUpdateRequired() { return false; }

Просмотреть файл

@ -10,11 +10,13 @@ class TestStatusLogger : public testing::EmptyTestEventListener {
public:
virtual void OnTestStart(testing::TestInfo const& test) override
{
std::ignore = test;
LOG_INFO("--- %s.%s", test.test_case_name(), test.name());
}
virtual void OnTestEnd(testing::TestInfo const& test) override
{
std::ignore = test;
LOG_INFO("=== %s.%s [%s]", test.test_case_name(), test.name(), test.result()->Passed() ? "OK" : "FAILED");
}
};

Просмотреть файл

@ -12,11 +12,13 @@ class TestStatusLogger : public testing::EmptyTestEventListener {
public:
virtual void OnTestStart(testing::TestInfo const& test) override
{
std::ignore = test;
LOG_INFO("--- %s.%s", test.test_case_name(), test.name());
}
virtual void OnTestEnd(testing::TestInfo const& test) override
{
std::ignore = test;
LOG_INFO("=== %s.%s [%s]", test.test_case_name(), test.name(), test.result()->Passed() ? "OK" : "FAILED");
}
};

5
tools/start-ide.cmd Normal file
Просмотреть файл

@ -0,0 +1,5 @@
set "ROOT=%~dp0\.."
REM Specify custom build options
set "CUSTOM_PROPS_VS=%ROOT%\Solutions\build.compact-min.props"
set "IDE=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe"
"%IDE%" "%ROOT%\Solutions\MSTelemetrySDK.sln"

57
tools/vcvars.cmd Normal file
Просмотреть файл

@ -0,0 +1,57 @@
@echo off
REM
REM Make sure to enable the 'Visual C++ ATL' components for all platforms during the setup.
REM
REM This build script auto-detects and configures Visual Studio in the following order:
REM 1. Visual Studio 2017 Enterprise
REM 2. Visual Studio 2017 BuildTools
REM 3. Visual Studio 2019 Enterprise
REM 4. Visual Studio 2019 Community
REM 5. Visual Studio 2019 BuildTools
REM
REM vs2017 Enterprise
set TOOLS_VS2017_ENTERPRISE="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
if exist %TOOLS_VS2017_ENTERPRISE% (
echo Building with vs2017 Enterprise...
call %TOOLS_VS2017_ENTERPRISE%
goto tools_configured
)
REM vs2017 BuildTools
set TOOLS_VS2017="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"
if exist %TOOLS_VS2017% (
echo Building with vs2017 BuildTools...
call %TOOLS_VS2017%
goto tools_configured
)
REM vs2019 Enterprise
set TOOLS_VS2019_ENTERPRISE="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
if exist %TOOLS_VS2019_ENTERPRISE% (
echo Building with vs2019 Enterprise...
call %TOOLS_VS2019_ENTERPRISE%
goto tools_configured
)
REM vs2019 Community
set TOOLS_VS2019_COMMUNITY="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
if exist %TOOLS_VS2019_COMMUNITY% (
echo Building with vs2019 Community...
call %TOOLS_VS2019_COMMUNITY%
goto tools_configured
)
REM vs2019 BuildTools
set TOOLS_VS2019="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
if exist %TOOLS_VS2019% (
echo Building with vs2019 BuildTools...
call %TOOLS_VS2017%
goto tools_configured
)
echo WARNING:*********************************************
echo WARNING: cannot auto-detect Visual Studio version !!!
echo WARNING:*********************************************
:tools_configured