@@ -91,12 +91,12 @@ Param (
91
91
)
92
92
93
93
if ($MultiTargets -eq ' all' ) {
94
- $MultiTargets = @ (' wasm' , ' uwp' , ' wasdk' , ' wpf' , ' linuxgtk' , ' macos' , ' ios' , ' android' , ' netstandard' )
94
+ $MultiTargets = @ (' wasm' , ' uwp' , ' wasdk' , ' wpf' , ' linuxgtk' , ' macos' , ' ios' , ' android' , ' netstandard' )
95
95
}
96
96
97
- if ($ExcludeMultiTargets -eq $null )
97
+ if ($null -eq $ExcludeMultiTargets )
98
98
{
99
- $ExcludeMultiTargets = @ ()
99
+ $ExcludeMultiTargets = @ ()
100
100
}
101
101
102
102
$MultiTargets = $MultiTargets | Where-Object { $_ -notin $ExcludeMultiTargets }
@@ -175,20 +175,30 @@ function Invoke-MSBuildWithBinlog {
175
175
176
176
# Components are built individually
177
177
foreach ($ComponentName in $Components ) {
178
- # Find all components source csproj (when wildcard), or find specific component csproj by name.
178
+ # Find all components source csproj (when wildcard), or find specific component csproj by name.
179
179
foreach ($componentCsproj in Get-ChildItem - Path " $PSScriptRoot /../components/$ComponentName /$ComponentDir /*.csproj" ) {
180
180
# Get component name from csproj path
181
181
$componentPath = Get-Item " $componentCsproj /../../"
182
182
183
183
# Get supported MultiTarget for this component
184
184
$supportedMultiTargets = & $PSScriptRoot \MultiTarget\Get-MultiTargets.ps1 - component $ ($componentPath.BaseName )
185
185
186
- # If this component doesn't list one of the provided MultiTargets, skip it
187
- if ($MultiTargets -notin $supportedMultiTargets ) {
188
- Write-Warning " Skipping $ ( $componentPath.BaseName ) , no supported MultiTargets were included for build."
186
+ # Flag to check if any of the requested targets are supported by the component
187
+ $isTargetSupported = $false
188
+
189
+ foreach ($requestedTarget in $MultiTargets ) {
190
+ if ($requestedTarget -in $supportedMultiTargets ) {
191
+ $isTargetSupported = $true
192
+ break
193
+ }
194
+ }
195
+
196
+ # If none of the requested targets are supported by the component, we can skip build to save time and avoid errors.
197
+ if (-not $isTargetSupported ) {
198
+ Write-Warning " Skipping $ ( $componentPath.BaseName ) , none of the requested MultiTargets are enabled for this component."
189
199
continue
190
200
}
191
201
192
202
Invoke-MSBuildWithBinlog $componentCsproj.FullName $EnableBinLogs $BinlogOutput
193
203
}
194
- }
204
+ }
0 commit comments