Skip to content

Commit

Permalink
Merge: release/1.2-stable to main
Browse files Browse the repository at this point in the history
  • Loading branch information
kythant committed Nov 11, 2022
2 parents 447be70 + 2648e20 commit 8a2e7fb
Show file tree
Hide file tree
Showing 44 changed files with 771 additions and 997 deletions.
102 changes: 24 additions & 78 deletions WindowsAppRuntime.sln

Large diffs are not rendered by default.

244 changes: 244 additions & 0 deletions build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-Steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
parameters:
solutionPath: ''
nugetConfigPath: ''
buildOutputDir: '$(Build.SourcesDirectory)\BuildOutput'
WindowsAppSDKCleanIntermediateFiles: 'true'
artifactName: 'drop'
channel: 'experimental'
enableLicenseInstall: false
# license installation assets are only accessible in internal builds, but are only
# needed in release-signed stable builds. Only enble this functionality in the private
# pipeline builds. Otherwise, default to an inert placeholder implementation.
runSDLBinaryAnalysis: false
enablePREFast: true

steps:
- ${{ if eq(parameters.enableLicenseInstall, true) }}:
- task: NuGetToolInstaller@1

- task: NuGetAuthenticate@1
inputs:
nuGetServiceConnections: 'ProjectReunionInternal'

# Restore transport package dependencies. This is only enbaled in release-signed builds.
- task: PowerShell@2
name: ConvertVersionDetailsToPackageConfig
displayName: "Convert VersionDetails To PackageConfig"
inputs:
filePath: '$(Build.SourcesDirectory)\build\Scripts\ConvertVersionDetailsToPackageConfig.ps1'
arguments: -versionDetailsPath '$(Build.SourcesDirectory)\eng\Version.Details.xml' -packageConfigPath '$(Build.SourcesDirectory)\build\packages.config'

- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: RestoreNuGetPackages
inputs:
restoreSolution: build/packages.config
feedsToUse: config
nugetConfigPath: build/licensing.nuget.config
restoreDirectory: packages

- template: WindowsAppSDK-PopulateBuildDateAndRevision-Steps.yml

- script: |
echo parameters.solutionPath = '${{ parameters.solutionPath }}'
echo parameters.nugetConfigPath = '${{ parameters.nugetConfigPath }}'
echo parameters.buildOutputDir = '${{ parameters.buildOutputDir }}'
displayName: 'BuildProject: Display parameters'
- template: WindowsAppSDK-InstallWindowsSDK-Steps.yml

- template: WindowsAppSDK-InstallNuget-Steps.yml

# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
- script: |
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
del %TEMP%\vsinstalldir.txt
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
echo VCToolsInstallDir = %VCToolsInstallDir%
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
displayName: 'Retrieve VC tools directory'
- task: CmdLine@1
displayName: 'Display build machine environment variables'
inputs:
filename: 'set'
- task: NuGetAuthenticate@1
inputs:
nuGetServiceConnections: 'WindowsES'
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore ${{ parameters.solutionPath }}'
inputs:
restoreSolution: ${{ parameters.solutionPath }}
feedsToUse: config
nugetConfigPath: ${{ parameters.nugetConfigPath }}
- task: powershell@2
displayName: 'Create test pfx to sign MSIX test packages (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create AppNotifications overrides'
inputs:
targetType: filePath
filePath: tools\GenerateDynamicDependencyOverrides.ps1
arguments: -Path $(Build.SourcesDirectory)\build\override
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create PushNotifications overrides'
inputs:
targetType: filePath
filePath: tools\GeneratePushNotificationsOverrides.ps1
arguments: -Path $(Build.SourcesDirectory)\build\override
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DynamicDependencies TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-AppNotifications.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.AppNotifications -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-AppNotifications.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DeploymentAPI TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DeploymentAPI.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DeploymentAPI.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create DynamicDependencies TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-DynamicDependency.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.ApplicationModel.DynamicDependency -Output $(Build.SourcesDirectory)\dev\common\MddTerminalVelocityFeatures.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 ${{ parameters.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:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PushNotifications.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.PushNotifications -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PushNotifications.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Create EnvironmentManager TerminalVelocity features'
inputs:
targetType: filePath
filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-EnvironmentManager.xml -Channel ${{ parameters.channel }} -Language C++ -Namespace Microsoft.Windows.System -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-EnvironmentManager.h
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
name: UpdateTraceloggingConfig
inputs:
targetType: 'inline'
script: |
$srcPath = Get-Childitem -Path 'dev\WindowsAppRuntime_Insights\packages' -File 'MicrosoftTelemetry.h' -Recurse
if (($srcPath -ne $null)){
$destinationPaths = Get-Childitem -Path 'packages' -File 'Traceloggingconfig.h' -Recurse
if (($destinationPaths -ne $null)) {
foreach ($destPath in $destinationPaths) {
Write-Host 'SourcePath:' $srcPath.FullName
Write-Host 'DestinationPath:' $destPath.FullName
Copy-Item -Force $srcPath.FullName $destPath.FullName
}
}
}
# Copy MSIX license installation header into the correct source location.
- ${{ if eq(parameters.enableLicenseInstall, true) }}:
- task: CopyFiles@2
displayName: 'Extract license header to source location'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\build\packages\$(AppLicensingInternalPackageName).$(AppLicensingInternalPackageVersion)\src'
Contents: |
*.h
TargetFolder: '$(Build.SourcesDirectory)\dev\Licensing'
flattenFolders: false
overWrite: true
- task: VSBuild@1
displayName: 'Build solution ${{ parameters.solutionPath }}'
inputs:
solution: ${{ parameters.solutionPath }}
vsVersion: 16.0
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/restore /p:AppxSymbolPackageEnabled=false /binaryLogger:$(Build.SourcesDirectory)/${{ parameters.solutionPath }}.$(buildPlatform).$(buildConfiguration).binlog /p:WindowsAppSDKVersionBuild=$(builddate_yymm) /p:WindowsAppSDKVersionRevision=$(builddate_dd)$(buildrevision) /p:VCToolsInstallDir="$(VCToolsInstallDir)\" /p:PGOBuildMode=$(PGOBuildMode) /p:WindowsAppSDKBuildPipeline=1 /p:WindowsAppSDKCleanIntermediateFiles=${{ parameters.WindowsAppSDKCleanIntermediateFiles }}'
- ${{ if eq(parameters.runSDLBinaryAnalysis, 'true') }}:
- template: WindowsAppSDK-BinaryAnalysis-steps.yml
parameters:
outputDirectory: '${{ parameters.buildOutputDir }}'
enablePREFast: ${{ parameters.enablePREFast }}
- task: powershell@2
displayName: 'Install test certificate for MSIX test packages (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -NoInteractive -Offline -Verbose -CheckTestCert
workingDirectory: '$(Build.SourcesDirectory)'
- task: powershell@2
displayName: 'Setup TAEF Service (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -Offline -Verbose -NoInteractive -CheckTAEFService
workingDirectory: '$(Build.SourcesDirectory)'
#DISABLED - GitHub runs as a a built-in Administrator (thus Elevated and no split-token)
# TAEF Service can't RunAs:RestrictedUser from this account thus all tests Failed or Blocked
# and Dynamic Dependencies doesn't support Elevation so it's impossible for this test to
# work correctly today. Disabling until we move off GitHub's pipeline for test execution
# - task: CmdLine@2
# displayName: 'Run AppLifeCycleTest'
# inputs:
# script: 'te.exe CppTest.dll'
# workingDirectory: '$(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform)\CppTest'
# condition: or(eq(variables.buildPlatform, 'x64'), eq(variables.buildPlatform, 'x86'))
- task: PublishBuildArtifacts@1
displayName: 'Publish ${{ parameters.solutionPath }} binlog'
condition: succeededOrFailed()
inputs:
PathtoPublish: $(Build.SourcesDirectory)/${{ parameters.solutionPath }}.$(buildPlatform).$(buildConfiguration).binlog
artifactName: binlogs
#UNDONE - subsequent PR
# - task: powershell@2
# displayName: 'Source Index PDBs'
# inputs:
# targetType: filePath
# filePath: build\SourceIndexing\IndexPdbs.ps1
# arguments: -SearchDir '${{ parameters.buildOutputDir }}\$(buildConfiguration)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
# errorActionPreference: silentlyContinue
- task: powershell@2
displayName: 'Remove test certificate for MSIX test packages (DevCheck)'
inputs:
targetType: filePath
filePath: tools\DevCheck.ps1
arguments: -NoInteractive -Offline -Verbose -RemoveTestCert -RemoveTestPfx
workingDirectory: '$(Build.SourcesDirectory)'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
nugetVersion: 5.11.0

steps:
- task: NuGetToolInstaller@1
displayName: 'Use NuGet ${{ parameters.nugetVersion }}'
inputs:
versionSpec: ${{ parameters.nugetVersion }}
2 changes: 1 addition & 1 deletion build/WindowsAppSDK-CommonVariables.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
channel: 'experimental'
channel: 'stable'
rerunPassesRequiredToAvoidFailure: 5
versionDate: $[format('{0:yyyyMMdd}', pipeline.startTime)]
versionCounter: $[counter(variables['versionDate'], 0)]
Expand Down
10 changes: 10 additions & 0 deletions dev/Common/AppModel.Package.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ inline std::vector<std::wstring> FindByFamily(const std::wstring& packageFamilyN
{
return FindByFamily(packageFamilyName.c_str());
}

inline PACKAGE_VERSION ToPackageVersion(winrt::Windows::ApplicationModel::PackageVersion const& from)
{
PACKAGE_VERSION to{};
to.Major = from.Major;
to.Minor = from.Minor;
to.Build = from.Build;
to.Revision = from.Revision;
return to;
}
}

#endif // __APPMODEL_PACKAGE_H
32 changes: 32 additions & 0 deletions dev/Common/TerminalVelocityFeatures-VersionInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT IT

// INPUT FILE: dev\common\TerminalVelocityFeatures-VersionInfo.xml
// OPTIONS: -Channel Experimental -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Path dev\common\TerminalVelocityFeatures-VersionInfo.xml -Output dev\common\TerminalVelocityFeatures-VersionInfo.h

#if defined(__midlrt)
namespace features
{
feature_name Feature_VersionInfoAPI = { DisabledByDefault, FALSE };
}
#endif // defined(__midlrt)

// Feature constants
#define WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED 1

#if defined(__cplusplus)

namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime
{

__pragma(detect_mismatch("ODR_violation_WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED_mismatch", "AlwaysEnabled"))
struct Feature_VersionInfoAPI
{
static constexpr bool IsEnabled() { return WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED == 1; }
};

} // namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime

#endif // defined(__cplusplus)
20 changes: 20 additions & 0 deletions dev/Common/TerminalVelocityFeatures-VersionInfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<features xmlns="http://microsoft.com/windowsappsdk/TerminalVelocity/20210729/TerminalVelocityFeatures.xsd">

<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE in the project root for license information.
-->

<!-- See docs/TerminalVelocity.md for more info. -->

<!-- Enabled variants -->
<feature>
<name>Feature_VersionInfoAPI</name>
<description>VersionInfo APIs to access Windows App SDK version information at runtime</description>
<state>AlwaysEnabled</state>
<alwaysDisabledChannelTokens>
<channelToken>Preview</channelToken>
<channelToken>Stable</channelToken>
</alwaysDisabledChannelTokens>
</feature>
</features>
22 changes: 22 additions & 0 deletions dev/Common/WindowsAppSDK-ProductInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

#ifndef __WINDOWSAPPSDK_PRODUCTINFO_H__
#define __WINDOWSAPPSDK_PRODUCTINFO_H__

#ifndef STR2
#define STR1(x) #x
#define VERSION_DELIMIMITER STR1(.)
#define STR2(a,b) STR1(a) VERSION_DELIMIMITER STR1(b)
#endif

#define WINDOWSAPPSDK_RELEASE_MAJOR 1
#define WINDOWSAPPSDK_RELEASE_MINOR 2

#define WINDOWSAPPSDK_PRODUCT_VERSION WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR
#define WINDOWSAPPSDK_PRODUCT_VERSION_STRING STR2(WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR)
#define WINDOWSAPPSDK_COMPANY_NAME "Microsoft Corporation"
#define WINDOWSAPPSDK_LEGAL_COPYRIGHT "Copyright (c) Microsoft Corporation. All rights reserved."
#define WINDOWSAPPSDK_PRODUCT_NAME "Windows App SDK"

#endif // __WINDOWSAPPSDK_PRODUCTINFO_H__
2 changes: 1 addition & 1 deletion dev/VSIX/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RestoreSources Condition="'$(RestoreSources)'==''">
https://pkgs.dev.azure.com/microsoft/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json
</RestoreSources>
<CppWinRTVersion Condition="'$(CppWinRTVersion)' == ''">2.0.221104.6</CppWinRTVersion>
<CppWinRTVersion Condition="'$(CppWinRTVersion)' == ''">2.0.220929.3</CppWinRTVersion>
<WindowsSDKBuildToolsVersion Condition="'$(WindowsSDKBuildToolsVersion)' == ''">10.0.22621.755</WindowsSDKBuildToolsVersion>
<WILVersion Condition="'$(WILVersion)' == ''">1.0.220914.1</WILVersion>
<!-- Provides a default package version in order to simplify dev inner loop testing -->
Expand Down
4 changes: 4 additions & 0 deletions dev/VersionInfo/VersionInfo.ReleaseInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <WindowsAppRuntime.VersionInfo.h>

#include <TerminalVelocityFeatures-VersionInfo.h>

namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
{
uint16_t ReleaseInfo::Major()
Expand Down Expand Up @@ -46,6 +48,8 @@ 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: 4 additions & 0 deletions dev/VersionInfo/VersionInfo.RuntimeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#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 @@ -29,6 +31,8 @@ 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
Loading

0 comments on commit 8a2e7fb

Please sign in to comment.