Skip to content

Commit 40e4936

Browse files
authored
Merge pull request #267 from CommunityToolkit/fix/ci/packages/multitarget-exclusion
Fixed multitarget exclusion preprocessing before UseTargetFrameworks script call
2 parents 03da938 + af77af2 commit 40e4936

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

Diff for: Build-Toolkit-Components.ps1

+18-17
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
Param (
6060
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
6161
[Alias("mt")]
62-
[string[]]$MultiTargets = @('uwp', 'wasm'), # default settings
62+
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'), # default settings
6363

6464
[ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
6565
[string[]]$ExcludeMultiTargets = @(), # default settings
@@ -95,13 +95,6 @@ Param (
9595
[switch]$Verbose
9696
)
9797

98-
# Use the specified MultiTarget TFM and WinUI version
99-
# WinUI 0 indicates non-WinUI projects (e.g. netstandard) should be built.
100-
if ($WinUIMajorVersion -ne 0) {
101-
& $PSScriptRoot\MultiTarget\UseUnoWinUI.ps1 $WinUIMajorVersion
102-
}
103-
104-
& $PSScriptRoot\MultiTarget\UseTargetFrameworks.ps1 -MultiTargets $MultiTargets -ExcludeMultiTargets $ExcludeMultiTargets
10598

10699
if ($MultiTargets -eq 'all') {
107100
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
@@ -114,20 +107,20 @@ if ($null -eq $ExcludeMultiTargets)
114107

115108
# Both uwp and wasdk share a targetframework. Both cannot be enabled at once.
116109
# If both are supplied, remove one based on WinUIMajorVersion.
117-
if ($MultiTargets.Contains('uwp') -and $MultiTargets.Contains('wasdk'))
110+
if ($WinUIMajorVersion -eq 2)
118111
{
119-
if ($WinUIMajorVersion -eq 2)
120-
{
121-
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
122-
}
123-
elseif ($WinUIMajorVersion -eq 3)
124-
{
125-
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
126-
}
112+
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
113+
}
114+
115+
if ($WinUIMajorVersion -eq 3)
116+
{
117+
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
127118
}
128119

129120
$MultiTargets = $MultiTargets | Where-Object { $_ -notin $ExcludeMultiTargets }
130121

122+
Write-Output "Building components '$Components' for MultiTargets: $MultiTargets"
123+
131124
if ($Components -eq @('all')) {
132125
$Components = @('**')
133126
}
@@ -136,6 +129,14 @@ if ($ExcludeComponents) {
136129
$Components = $Components | Where-Object { $_ -notin $ExcludeComponents }
137130
}
138131

132+
# Use the specified MultiTarget TFM and WinUI version
133+
# WinUI 0 indicates non-WinUI projects (e.g. netstandard) should be built.
134+
if ($WinUIMajorVersion -ne 0) {
135+
& $PSScriptRoot\MultiTarget\UseUnoWinUI.ps1 $WinUIMajorVersion
136+
}
137+
138+
& $PSScriptRoot\MultiTarget\UseTargetFrameworks.ps1 -MultiTargets $MultiTargets -ExcludeMultiTargets $ExcludeMultiTargets
139+
139140
function Invoke-MSBuildWithBinlog {
140141
param (
141142
[string]$TargetHeadPath

0 commit comments

Comments
 (0)