Skip to content

Commit

Permalink
Publish experimental VersionInfo API (#5001)
Browse files Browse the repository at this point in the history
* Revert "Make VersionInfo [Experimental] until it is fully working (#3542)"

This reverts commit e8530c4.

* Revert "Add TerminalVelocity build steps for Version Info (#3552)"

This reverts commit 58b8c98.

* Revert "VersionInfo WinRT API can be used in non-experimental builds or compile errors (#3691)"

This reverts commit 30d849a.
  • Loading branch information
Scottj1s authored Jan 8, 2025
1 parent 430b3a2 commit 80e530d
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,6 @@ steps:
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-AppNotifications.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Windows.AppNotifications -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-AppNotifications.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create VersionInfo TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-VersionInfo.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-VersionInfo.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create PushNotifications TerminalVelocity features'
inputs:
Expand Down
32 changes: 0 additions & 32 deletions dev/Common/TerminalVelocityFeatures-VersionInfo.h

This file was deleted.

20 changes: 0 additions & 20 deletions dev/Common/TerminalVelocityFeatures-VersionInfo.xml

This file was deleted.

4 changes: 0 additions & 4 deletions dev/VersionInfo/VersionInfo.ReleaseInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <WindowsAppRuntime.VersionInfo.h>

#include <TerminalVelocityFeatures-VersionInfo.h>

namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
{
uint16_t ReleaseInfo::Major()
Expand Down Expand Up @@ -48,8 +46,6 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem

const ::Microsoft::WindowsAppSDK::VersionInfo& ReleaseInfo::GetVersionInfo()
{
THROW_HR_IF(E_NOTIMPL, !::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Feature_VersionInfoAPI::IsEnabled());

const ::Microsoft::WindowsAppSDK::VersionInfo* versionInfo{ ::Microsoft::WindowsAppSDK::GetVersionInfo() };
return *versionInfo;
}
Expand Down
4 changes: 0 additions & 4 deletions dev/VersionInfo/VersionInfo.RuntimeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include <Microsoft.Windows.ApplicationModel.WindowsAppRuntime.RuntimeInfo.g.cpp>

#include <TerminalVelocityFeatures-VersionInfo.h>

namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
{
winrt::Windows::ApplicationModel::PackageVersion RuntimeInfo::Version()
Expand All @@ -31,8 +29,6 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem

const ::Microsoft::WindowsAppSDK::VersionInfo& RuntimeInfo::GetVersionInfo()
{
THROW_HR_IF(E_NOTIMPL, !::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Feature_VersionInfoAPI::IsEnabled());

const ::Microsoft::WindowsAppSDK::VersionInfo* versionInfo{ ::Microsoft::WindowsAppSDK::GetVersionInfo() };
return *versionInfo;
}
Expand Down
5 changes: 0 additions & 5 deletions dev/VersionInfo/VersionInfo.idl
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#include <TerminalVelocityFeatures-VersionInfo.h>

namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
{
[feature(Feature_VersionInfoAPI)]
[contractversion(1)]
apicontract VersionInfoContract{};

/// Version information for the Windows App SDK release.
[feature(Feature_VersionInfoAPI)]
[contract(VersionInfoContract, 1)]
static runtimeclass ReleaseInfo
{
Expand All @@ -31,7 +27,6 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
};

/// Version information for the Windows App SDK runtime.
[feature(Feature_VersionInfoAPI)]
[contract(VersionInfoContract, 1)]
static runtimeclass RuntimeInfo
{
Expand Down
2 changes: 1 addition & 1 deletion dev/VersionInfo/VersionInfo.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
20 changes: 0 additions & 20 deletions test/VersionInfo/VersionInfoTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,10 @@ namespace Test::VersionInfo

TEST_METHOD(VersionInfo_Release)
{
if (::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Feature_VersionInfoAPI::IsEnabled())
{
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
return;
}

try
{
#if defined(WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED)
auto release{ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::ReleaseInfo::AsString() };
VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll");
#else
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
#endif
}
catch (winrt::hresult_error& e)
{
Expand All @@ -53,20 +43,10 @@ namespace Test::VersionInfo

TEST_METHOD(VersionInfo_Runtime)
{
if (::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Feature_VersionInfoAPI::IsEnabled())
{
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
return;
}

try
{
#if defined(WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED)
auto runtime{ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::RuntimeInfo::AsString() };
VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll");
#else
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
#endif
}
catch (winrt::hresult_error& e)
{
Expand Down
2 changes: 1 addition & 1 deletion test/VersionInfo/VersionInfoTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>$(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="$(WindowsAppSDKBuildPipeline) == '1'">$(RepoRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
Expand Down
2 changes: 0 additions & 2 deletions test/VersionInfo/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@
#include <WindowsAppRuntime.Test.Package.h>
#include <WindowsAppRuntime.Test.Bootstrap.h>

#include <TerminalVelocityFeatures-VersionInfo.h>

#endif //PCH_H

0 comments on commit 80e530d

Please sign in to comment.