Skip to content

Commit b693fd4

Browse files
authored
wap: add some workaround to ensure that our package builds on 16.3 (#2730)
Fixes #2625.
1 parent 1fccbc5 commit b693fd4

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

build/scripts/Test-WindowsTerminalPackage.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ Try {
7474
If ($null -eq $AppXbf) {
7575
Throw "Failed to find App.xbf (TerminalApp project) in resources.pri"
7676
}
77+
78+
If ($Manifest.Package.Identity.ProcessorArchitecture -Ne "arm64") {
79+
### ARM64 doesn't package cpprest_2_10.
80+
If (($null -eq (Get-Item "$AppxPackageRootPath\cpprest_2_10.dll" -EA:Ignore)) -And
81+
($null -eq (Get-Item "$AppxPackageRootPath\cpprest_2_10d.dll" -EA:Ignore))) {
82+
Throw "Failed to find cpprest_2_10.dll -- check the WAP packaging project"
83+
}
84+
}
7785
} Finally {
7886
Remove-Item -Recurse -Force $AppxPackageRootPath
7987
}

src/cascadia/CascadiaPackage/CascadiaPackage.wapproj

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@
295295
important reasons), that doesn't work for us.
296296
-->
297297
<PropertyGroup>
298-
<_GenerateProjectPriFileDependsOn>OpenConsoleLiftDesktopBridgePriFiles;$(_GenerateProjectPriFileDependsOn)</_GenerateProjectPriFileDependsOn>
298+
<!-- Only for MSBuild versions < 16.3.0 -->
299+
<_GenerateProjectPriFileDependsOn Condition="$(MSBuildVersion) &lt; '16.3.0'">OpenConsoleLiftDesktopBridgePriFiles;$(_GenerateProjectPriFileDependsOn)</_GenerateProjectPriFileDependsOn>
299300
</PropertyGroup>
300301
<Target Name="OpenConsoleLiftDesktopBridgePriFiles" DependsOnTargets="_ConvertItems">
301302
<ItemGroup>
@@ -305,4 +306,25 @@
305306
</ItemGroup>
306307
</Target>
307308

309+
<!-- VS 16.3.0 added a rule to the WAP packaging project that removes all non-WAP payload, which we were relying on to
310+
roll up our subproject resources. We have to suppress that rule but keep part of its logic, because that rule is
311+
where the AppxPackagePayload items are created. -->
312+
<PropertyGroup>
313+
<!-- Only for MSBuild versions <= 16.4.0 -->
314+
<!-- TODO: Change this to hard less than once the 16.4.0 previews fix the bug. -->
315+
<WapProjBeforeGenerateAppxManifestDependsOn
316+
Condition="$(MSBuildVersion) &lt;= '16.4.0'">
317+
$([MSBuild]::Unescape('$(WapProjBeforeGenerateAppxManifestDependsOn.Replace('_RemoveAllNonWapUWPItems', '_OpenConsoleRemoveAllNonWapUWPItems'))'))
318+
</WapProjBeforeGenerateAppxManifestDependsOn>
319+
</PropertyGroup>
320+
<Target Name="_OpenConsoleRemoveAllNonWapUWPItems">
321+
<ItemGroup>
322+
<AppxPackagePayload Include="@(WapProjPackageFile)" />
323+
<AppxUploadPackagePayload Include="@(UploadWapProjPackageFile)" />
324+
<!-- 16.3.0 - remove non-resources.pri PRI files since we just forced them back in. -->
325+
<AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(Extension)' == '.pri' and '%(Filename)' != 'resources'" />
326+
<AppxUploadPackagePayload Remove="@(AppxUploadPackagePayload)" Condition="'%(Extension)' == '.pri' and '%(Filename)' != 'resources'" />
327+
</ItemGroup>
328+
</Target>
329+
308330
</Project>

0 commit comments

Comments
 (0)