Skip to content

Commit 93ddc19

Browse files
author
PankajBhojwani
authored
Merge branch 'master' into realAzCon
2 parents 14e12e2 + dca0ffe commit 93ddc19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2985
-1853
lines changed

build/pipelines/templates/build-console-steps.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ steps:
4646
clean: true
4747
maximumCpuCount: true
4848

49+
- task: PowerShell@2
50+
displayName: 'Check MSIX for common regressions'
51+
inputs:
52+
targetType: inline
53+
script: |
54+
$Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix"
55+
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName
56+
4957
- task: VSTest@2
5058
displayName: 'Run Unit Tests'
5159
inputs:
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[CmdletBinding()]
2+
Param(
3+
[Parameter(Mandatory=$true, ValueFromPipeline=$true,
4+
HelpMessage="Path to the .appx/.msix to validate")]
5+
[string]
6+
$Path,
7+
8+
[Parameter(HelpMessage="Path to Windows Kit")]
9+
[ValidateScript({Test-Path $_ -Type Leaf})]
10+
[string]
11+
$WindowsKitPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0"
12+
)
13+
14+
$ErrorActionPreference = "Stop"
15+
16+
If ($null -Eq (Get-Item $WindowsKitPath -EA:SilentlyContinue)) {
17+
Write-Error "Could not find a windows SDK at at `"$WindowsKitPath`".`nMake sure that WindowsKitPath points to a valid SDK."
18+
Exit 1
19+
}
20+
21+
$makeAppx = "$WindowsKitPath\x86\MakeAppx.exe"
22+
$makePri = "$WindowsKitPath\x86\MakePri.exe"
23+
24+
Function Expand-ApplicationPackage {
25+
Param(
26+
[Parameter(Mandatory, ValueFromPipeline)]
27+
[string]
28+
$Path
29+
)
30+
31+
$sentinelFile = New-TemporaryFile
32+
$directory = New-Item -Type Directory "$($sentinelFile.FullName)_Package"
33+
Remove-Item $sentinelFile -Force -EA:Ignore
34+
35+
& $makeAppx unpack /p $Path /d $directory /nv /o
36+
37+
If ($LastExitCode -Ne 0) {
38+
Throw "Failed to expand AppX"
39+
}
40+
41+
$directory
42+
}
43+
44+
Write-Verbose "Expanding $Path"
45+
$AppxPackageRoot = Expand-ApplicationPackage $Path
46+
$AppxPackageRootPath = $AppxPackageRoot.FullName
47+
48+
Write-Verbose "Expanded to $AppxPackageRootPath"
49+
50+
Try {
51+
& $makePri dump /if "$AppxPackageRootPath\resources.pri" /of "$AppxPackageRootPath\resources.pri.xml" /o
52+
If ($LastExitCode -Ne 0) {
53+
Throw "Failed to dump PRI"
54+
}
55+
56+
$Manifest = [xml](Get-Content "$AppxPackageRootPath\AppxManifest.xml")
57+
$PRIFile = [xml](Get-Content "$AppxPackageRootPath\resources.pri.xml")
58+
59+
### Check the activatable class entries for a few DLLs we need.
60+
$inProcServers = $Manifest.Package.Extensions.Extension.InProcessServer.Path
61+
$RequiredInProcServers = ("TerminalApp.dll", "TerminalControl.dll", "TerminalConnection.dll")
62+
63+
Write-Verbose "InProc Servers: $inProcServers"
64+
65+
ForEach ($req in $RequiredInProcServers) {
66+
If ($req -NotIn $inProcServers) {
67+
Throw "Failed to find $req in InProcServer list $inProcServers"
68+
}
69+
}
70+
71+
### Check that we have an App.xbf (which is a proxy for our resources having been merged)
72+
$resourceXpath = '/PriInfo/ResourceMap/ResourceMapSubtree[@name="Files"]/NamedResource[@name="App.xbf"]'
73+
$AppXbf = $PRIFile.SelectSingleNode($resourceXpath)
74+
If ($null -eq $AppXbf) {
75+
Throw "Failed to find App.xbf (TerminalApp project) in resources.pri"
76+
}
77+
} Finally {
78+
Remove-Item -Recurse -Force $AppxPackageRootPath
79+
}

src/cascadia/CascadiaPackage/CascadiaPackage.wapproj

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -262,24 +262,6 @@
262262
<PRIResource Include="Resources\en-US\Resources.resw" />
263263
</ItemGroup>
264264
<Import Project="$(OpenConsoleDir)src\wap-common.build.post.props" />
265-
<!--
266-
Microsoft.UI.Xaml contains some <Content> resource files that need to be included in our package.
267-
For some reason, they're not rolled up through dependent projects; if they were, their paths would
268-
be wrong.
269-
270-
WAP Packaging projects don't actually support nuget package references, so we added one manually.
271-
272-
This does mean that version changes to Microsoft.UI.Xaml must be manually reflected
273-
here.
274-
-->
275-
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.2.190611001-prerelease\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.2.190611001-prerelease\build\native\Microsoft.UI.Xaml.targets')" />
276-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
277-
<PropertyGroup>
278-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
279-
</PropertyGroup>
280-
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.2.190611001-prerelease\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.2.190611001-prerelease\build\native\Microsoft.UI.Xaml.targets'))" />
281-
</Target>
282-
<!-- End workaround -->
283265
<ItemGroup>
284266
<ProjectReference Include="..\WindowsTerminal\WindowsTerminal.vcxproj" />
285267
<ProjectReference Include="..\..\host\exe\Host.EXE.vcxproj" />

0 commit comments

Comments
 (0)