-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathFilter-Supported-Components.ps1
More file actions
69 lines (53 loc) · 2.22 KB
/
Filter-Supported-Components.ps1
File metadata and controls
69 lines (53 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<#
.SYNOPSIS
Given a list of components, filters them based on their support for the specified MultiTarget TFM(s) and WinUI major version.
.DESCRIPTION
This script checks each component to determine if it supports the specified MultiTarget TFM(s) and WinUI major version.
It returns a list of components that are supported for the given parameters.
.PARAMETER MultiTargets
Specifies the MultiTarget TFM(s) to include for building the components.
.PARAMETER WinUIMajorVersion
Specifies the WinUI major version to use when building for Uno. Also decides the package id and dependency variant.
.NOTES
Author: Arlo Godfrey
Date: 6/6/2025
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[Parameter(Mandatory=$true)]
[string[]]$MultiTargets,
[Alias("c")]
[Parameter(Mandatory=$true)]
[string[]]$Components,
[Alias("winui")]
[Parameter(Mandatory=$true)]
[int]$WinUIMajorVersion
)
if ($MultiTargets -eq 'all') {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')
}
$supportedComponents = @();
if ($Components -eq @('all')) {
$Components = @('**')
}
foreach ($ComponentName in $Components) {
# Find all components source csproj (when wildcard), or find specific component csproj by name.
$path = "$PSScriptRoot/../../components/$ComponentName/src/*.csproj"
foreach ($componentCsproj in Get-ChildItem -Path $path) {
# Get component name from csproj path
$componentPath = Get-Item "$componentCsproj/../../"
$componentName = $($componentPath.BaseName);
# Get supported MultiTarget for this component
$supportedMultiTargets = & $PSScriptRoot\Get-MultiTargets.ps1 -component $componentName
$componentSupportResult = & $PSScriptRoot\Test-Component-Support.ps1 `
-RequestedMultiTargets $MultiTargets `
-SupportedMultiTargets $supportedMultiTargets `
-Component $componentName `
-WinUIMajorVersion $WinUIMajorVersion
if ($componentSupportResult.IsSupported -eq $true) {
$supportedComponents += $componentName
}
}
}
return $supportedComponents;