diff --git a/Build-Toolkit-Components.ps1 b/Build-Toolkit-Components.ps1 index 068f96d7..d797d5df 100644 --- a/Build-Toolkit-Components.ps1 +++ b/Build-Toolkit-Components.ps1 @@ -58,11 +58,13 @@ #> Param ( [ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] - [string[]]$MultiTargets = @('all'), + [Alias("mt")] + [string[]]$MultiTargets = @('uwp', 'wasdk', 'wasm'), # default settings [ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] - [string[]]$ExcludeMultiTargets = @('wpf', 'linuxgtk', 'macos', 'ios', 'android'), + [string[]]$ExcludeMultiTargets = @(), # default settings + [Alias("c")] [string[]]$Components = @("all"), [string[]]$ExcludeComponents, @@ -76,10 +78,13 @@ Param ( [Alias("bl")] [switch]$EnableBinLogs, + [Alias("blo")] [string]$BinlogOutput, - + + [Alias("p")] [hashtable]$AdditionalProperties, + [Alias("winui")] [int]$WinUIMajorVersion = 2, [string]$ComponentDir = "src", diff --git a/Build-Toolkit-Gallery.ps1 b/Build-Toolkit-Gallery.ps1 index 72070fa0..b08abe47 100644 --- a/Build-Toolkit-Gallery.ps1 +++ b/Build-Toolkit-Gallery.ps1 @@ -12,7 +12,7 @@ Specifies the MultiTarget TFM(s) to exclude for building the components. The default value excludes targets that require additional tooling or workloads to build: 'wpf', 'linuxgtk', 'macos', 'ios', and 'android'. Run uno-check to install the required workloads. .PARAMETER Heads - The heads to include in the build. Default is 'Uwp', 'WinAppSdk', 'Wasm'. + The heads to include in the build. Default is 'Uwp', 'Wasdk', 'Wasm'. .PARAMETER ExcludeHeads The heads to exclude from the build. Default is none. @@ -47,26 +47,31 @@ #> Param ( [ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] - [string[]]$MultiTargets = @('all'), + [Alias("mt")] + [string[]]$MultiTargets = @('uwp', 'wasdk', 'wasm'), # default settings [ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] - [string[]]$ExcludeMultiTargets = @('wpf', 'linuxgtk', 'macos', 'ios', 'android'), + [string[]]$ExcludeMultiTargets = @() # default settings - [ValidateSet('all', 'Uwp', 'WinAppSdk', 'Wasm', 'Tests.Uwp', 'Tests.WinAppSdk')] - [string[]]$Heads = @('Uwp', 'WinAppSdk', 'Wasm'), + [ValidateSet('all', 'Uwp', 'Wasdk', 'Wasm', 'Tests.Uwp', 'Tests.Wasdk')] + [string[]]$Heads = @('Uwp', 'Wasdk', 'Wasm'), - [ValidateSet('Uwp', 'WinAppSdk', 'Wasm', 'Tests.Uwp', 'Tests.WinAppSdk')] + [ValidateSet('Uwp', 'Wasdk', 'Wasm', 'Tests.Uwp', 'Tests.Wasdk')] [string[]]$ExcludeHeads, [Alias("bl")] [switch]$EnableBinLogs, + [Alias("blo")] [string]$BinlogOutput, + [Alias("p")] [hashtable]$AdditionalProperties, + [Alias("winui")] [int]$WinUIMajorVersion = 2, + [Alias("c")] [string[]]$Components = @("all"), [string[]]$ExcludeComponents, @@ -113,7 +118,7 @@ if ($Components -notcontains 'Converters') { & $PSScriptRoot\MultiTarget\GenerateAllProjectReferences.ps1 -MultiTarget $MultiTargets -Components $Components if ($Heads -eq 'all') { - $Heads = @('Uwp', 'WinAppSdk', 'Wasm', 'Tests.Uwp', 'Tests.WinAppSdk') + $Heads = @('Uwp', 'Wasdk', 'Wasm', 'Tests.Uwp', 'Tests.Wasdk') } function Invoke-MSBuildWithBinlog { diff --git a/GenerateAllSolution.ps1 b/GenerateAllSolution.ps1 index 888888f9..1ef1efac 100644 --- a/GenerateAllSolution.ps1 +++ b/GenerateAllSolution.ps1 @@ -1,35 +1,73 @@ <# .SYNOPSIS Generates the solution file comprising of platform heads for samples, individual component projects, and tests. + .DESCRIPTION Used mostly for CI building of everything and testing end-to-end scenarios involving the full sample app experience. Otherwise it is recommended to focus on an individual component's solution instead. -.PARAMETER IncludeHeads - List of TFM based projects to include. This can be 'all', 'uwp', or 'winappsdk'. - Defaults to 'all' for local-use. +.PARAMETER MultiTargets + Specifies the MultiTarget TFM(s) to include for building the components. The default value is 'all'. + +.PARAMETER ExcludeMultiTargets + Specifies the MultiTarget TFM(s) to exclude for building the components. The default value excludes targets that require additional tooling or workloads to build. Run uno-check to install the required workloads. + +.PARAMETER Components + The names of the components to generate project and solution references for. Defaults to all components. + +.PARAMETER ExcludeComponents + The names of the components to exclude when generating solution and project references. Defaults to none. + +.PARAMETER WinUIMajorVersion + Specifies the WinUI major version to use when building an Uno head. Also decides the package id and dependency variant. The default value is '2'. + .PARAMETER UseDiagnostics Add extra diagnostic output to running slngen, such as a binlog, etc... + .EXAMPLE - C:\PS> .\GenerateAllSolution -IncludeHeads winappsdk + C:\PS> .\GenerateAllSolution -MultiTargets wasdk Build a solution that doesn't contain UWP projects. + .NOTES Author: Windows Community Toolkit Labs Team Date: April 27, 2022 #> Param ( - [Parameter(HelpMessage = "The heads to include for building platform samples and tests.", ParameterSetName = "IncludeHeads")] - [ValidateSet('all', 'uwp', 'winappsdk')] - [string]$IncludeHeads = 'all', + [ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android')] + [Alias("mt")] + [string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'), + + [ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] + [string[]]$ExcludeMultiTargets = @(), # default settings + + [Alias("c")] + [string[]]$Components = @('all'), + + [Alias("winui")] + [int]$WinUIMajorVersion = 2, + + [string[]]$ExcludeComponents, - [Parameter(HelpMessage = "Add extra diagnostic output to slngen generator.")] [switch]$UseDiagnostics = $false ) +if ($MultiTargets.Contains('all')) { + $MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android') +} + +if ($null -eq $ExcludeMultiTargets) +{ + $ExcludeMultiTargets = @() +} + +$MultiTargets = $MultiTargets | Where-Object { $_ -notin $ExcludeMultiTargets } + # Generate required props for "All" solution. -& ./tooling/MultiTarget/GenerateAllProjectReferences.ps1 +& ./tooling/MultiTarget/GenerateAllProjectReferences.ps1 -MultiTargets $MultiTargets -Components $Components -ExcludeComponents $ExcludeComponents +& ./tooling/MultiTarget/UseTargetFrameworks.ps1 -MultiTargets $MultiTargets +& ./tooling/MultiTarget/UseUnoWinUI.ps1 $WinUIMajorVersion # Set up constant values $generatedSolutionFilePath = 'CommunityToolkit.AllComponents.sln' @@ -55,30 +93,58 @@ $projects = [System.Collections.ArrayList]::new() # Common/Dependencies for shared infrastructure [void]$projects.Add(".\tooling\CommunityToolkit*\*.*proj") -# App Head and Test Head -if ($IncludeHeads -ne 'winappsdk') -{ - [void]$projects.Add(".\tooling\ProjectHeads\AllComponents\**\*.Uwp.csproj") +# Deployable sample gallery heads +# TODO: this handles separate project heads, but won't directly handle the unified Skia head from Uno. +# Once we have that, just do a transform on the csproj filename inside this loop to decide the same csproj for those separate MultiTargets. +foreach ($multitarget in $MultiTargets) { + # capitalize first letter, avoid case sensitivity issues on linux + $csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower() + + $path = ".\tooling\ProjectHeads\AllComponents\**\*.$csprojFileNamePartForMultiTarget.csproj"; + + if (Test-Path $path) { + [void]$projects.Add($path) + } + else { + Write-Warning "No project head could be found at $path for MultiTarget $multitarget. Skipping." + } } -if ($IncludeHeads -ne 'uwp') -{ - [void]$projects.Add(".\tooling\ProjectHeads\AllComponents\**\*.WinAppSdk.csproj") +# Individual projects +if ($Components -eq @('all')) { + $Components = @('**') } -[void]$projects.Add(".\tooling\ProjectHeads\AllComponents\**\*.Wasm.csproj") - -# Individual projects -[void]$projects.Add(".\components\**\src\*.csproj") -[void]$projects.Add(".\components\**\samples\*.Samples.csproj") -[void]$projects.Add(".\components\**\tests\*.Tests\*.shproj") +foreach ($componentName in $Components) { + if ($ExcludeComponents -contains $componentName) { + continue; + } + + foreach ($componentPath in Get-Item "$PSScriptRoot/../components/$componentName/") { + $multiTargetPrefs = & $PSScriptRoot\MultiTarget\Get-MultiTargets.ps1 -component $($componentPath.BaseName) + + $shouldReferenceInSolution = $multiTargetPrefs.Where({ $MultiTargets.Contains($_) }).Count -gt 0 + + if ($shouldReferenceInSolution) { + Write-Output "Add component $componentPath to solution"; + + [void]$projects.Add(".\components\$($componentPath.BaseName)\src\*.csproj") + [void]$projects.Add(".\components\$($componentPath.BaseName)\samples\*.Samples.csproj") + [void]$projects.Add(".\components\$($componentPath.BaseName)\tests\*.Tests\*.shproj") + } else { + Write-Warning "Component $($componentPath.BaseName) doesn't MultiTarget any of $MultiTargets and won't be added to the solution."; + } + } +} if ($UseDiagnostics.IsPresent) { $sdkoptions = "-d" $diagnostics = @( '-bl:slngen.binlog' - '--consolelogger:ShowEventId;Summary;Verbosity=Detailed' + # Console logger + binlog causes exception and failure + # Track https://github.com/microsoft/slngen/issues/451 + #'--consolelogger:ShowEventId;Summary;Verbosity=Detailed' ) } else diff --git a/MultiTarget/GenerateAllProjectReferences.ps1 b/MultiTarget/GenerateAllProjectReferences.ps1 index 821c8f1c..1cca529e 100644 --- a/MultiTarget/GenerateAllProjectReferences.ps1 +++ b/MultiTarget/GenerateAllProjectReferences.ps1 @@ -3,7 +3,9 @@ Param ( [string]$projectPropsOutputDir = "$PSScriptRoot/Generated", [Parameter(HelpMessage = "Only projects that support these targets will have references generated for use by deployable heads.")] - [string[]]$MultiTarget = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard"), + [Alias("mt")] + [ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] + [string[]]$MultiTargets = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard"), [Parameter(HelpMessage = "The names of the components to generate references for. Defaults to all components.")] [string[]]$Components = @("all"), @@ -30,8 +32,6 @@ foreach ($componentName in $Components) { # Find all components source csproj (when wildcard), or find specific component csproj by name. foreach ($componentPath in Get-Item "$PSScriptRoot/../../components/$componentName/") { - Write-Output "Generating project references for component $componentName at $componentPath"; - # Find source and sample csproj files $componentSourceCsproj = Get-ChildItem $componentPath/src/*.csproj -ErrorAction SilentlyContinue; $componentSampleCsproj = Get-ChildItem $componentPath/samples/*.csproj -ErrorAction SilentlyContinue; @@ -39,11 +39,11 @@ foreach ($componentName in $Components) { # Generate s for sample project # Use source project MultiTarget as first fallback. if ($null -ne $componentSampleCsproj -and (Test-Path $componentSampleCsproj)) { - & $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 -projectPath $componentSampleCsproj -outputPath "$projectPropsOutputDir/$($componentSampleCsproj.BaseName).props" -MultiTarget $MultiTarget + & $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 -projectPath $componentSampleCsproj -outputPath "$projectPropsOutputDir/$($componentSampleCsproj.BaseName).props" -MultiTargets $MultiTargets } # Generate s for src project - & $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 -projectPath $componentSourceCsproj -outputPath "$projectPropsOutputDir/$($componentSourceCsproj.BaseName).props" -MultiTarget $MultiTarget + & $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 -projectPath $componentSourceCsproj -outputPath "$projectPropsOutputDir/$($componentSourceCsproj.BaseName).props" -MultiTargets $MultiTargets } } diff --git a/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 b/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 index a87f2603..6890d89e 100644 --- a/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 +++ b/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 @@ -16,7 +16,8 @@ Param ( [Parameter(HelpMessage = "Only projects that support these targets will have references generated for use by deployable heads.")] [ValidateSet("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard")] - [string[]] $MultiTarget = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard") + [Alias("mt")] + [string[]] $MultiTargets = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard") ) $templateContents = Get-Content -Path $templatePath; @@ -40,35 +41,44 @@ $templateContents = $templateContents -replace [regex]::escape($projectRootPlace $componentPath = Get-Item "$projectPath/../../" # Load multitarget preferences for component -$multiTargets = & $PSScriptRoot\Get-MultiTargets.ps1 -component $($componentPath.BaseName) +$multiTargetPrefs = & $PSScriptRoot\Get-MultiTargets.ps1 -component $($componentPath.BaseName) -if ($null -eq $multiTargets) { +if ($null -eq $multiTargetPrefs) { Write-Error "Couldn't get MultiTarget property for $componentPath"; exit(-1); } -# Ensure multiTargets is not empty -if ($multiTargets.Length -eq 0) { +# Ensure multiTargetPrefs is not empty +if ($multiTargetPrefs.Length -eq 0) { Write-Error "MultiTarget property is empty for $projectPath"; exit(-1); } -$templateContents = $templateContents -replace [regex]::escape("[IntendedTargets]"), $multiTargets; +$templateContents = $templateContents -replace [regex]::escape("[IntendedTargets]"), $multiTargetPrefs; function ShouldMultiTarget([string] $target) { - return ($multiTargets.Contains($target) -and $MultiTarget.Contains($target)).ToString().ToLower() + return ($multiTargetPrefs.Contains($target) -and $MultiTargets.Contains($target)) } -Write-Host "Generating project references for $([System.IO.Path]::GetFileNameWithoutExtension($csprojFileName)): $($multiTargets -Join ', ')" -$templateContents = $templateContents -replace [regex]::escape("[CanTargetWasm]"), "'$(ShouldMultiTarget "wasm")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetUwp]"), "'$(ShouldMultiTarget "uwp")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetWasdk]"), "'$(ShouldMultiTarget "wasdk")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetWpf]"), "'$(ShouldMultiTarget "wpf")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetLinuxGtk]"), "'$(ShouldMultiTarget "linuxgtk")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetMacOS]"), "'$(ShouldMultiTarget "macos")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetiOS]"), "'$(ShouldMultiTarget "ios")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetDroid]"), "'$(ShouldMultiTarget "droid")'"; -$templateContents = $templateContents -replace [regex]::escape("[CanTargetNetstandard]"), "'$(ShouldMultiTarget "netstandard")'"; +function ShouldMultiTargetMsBuildValue([string] $target) { + return $(ShouldMultiTarget $target).ToString().ToLower() +} + +$targeted = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard").Where({ ShouldMultiTarget $_ }) + +if ($targeted.Count -gt 0) { + Write-Host "Generating project references for $([System.IO.Path]::GetFileNameWithoutExtension($csprojFileName)): $($targeted -Join ', ')" +} + +$templateContents = $templateContents -replace [regex]::escape("[CanTargetWasm]"), "'$(ShouldMultiTargetMsBuildValue "wasm")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetUwp]"), "'$(ShouldMultiTargetMsBuildValue "uwp")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetWasdk]"), "'$(ShouldMultiTargetMsBuildValue "wasdk")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetWpf]"), "'$(ShouldMultiTargetMsBuildValue "wpf")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetLinuxGtk]"), "'$(ShouldMultiTargetMsBuildValue "linuxgtk")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetMacOS]"), "'$(ShouldMultiTargetMsBuildValue "macos")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetiOS]"), "'$(ShouldMultiTargetMsBuildValue "ios")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetDroid]"), "'$(ShouldMultiTargetMsBuildValue "android")'"; +$templateContents = $templateContents -replace [regex]::escape("[CanTargetNetstandard]"), "'$(ShouldMultiTargetMsBuildValue "netstandard")'"; # Save to disk Set-Content -Path $outputPath -Value $templateContents; diff --git a/MultiTarget/UseTargetFrameworks.ps1 b/MultiTarget/UseTargetFrameworks.ps1 index b79ff2b8..544c2b5a 100644 --- a/MultiTarget/UseTargetFrameworks.ps1 +++ b/MultiTarget/UseTargetFrameworks.ps1 @@ -7,24 +7,28 @@ that works on all supported platforms. Note: Projects which rely on target platforms that are excluded will be unable to build. -.PARAMETER targets - List of targets to set as TFM platforms to build for. Possible values match those provided to the MSBuild property, as well as 'all', 'all-uwp', 'all-wasdk', or blank. - When run as blank, the defaults (uwp, winappsdk, wasm) will be used. - 'all', 'all-uwp', and 'all-wasdk' shouldn't be used with other targets or each other. -.PARAMETER allowGitChanges - Enabling this flag will allow changes to the props file to be checked into source control. - By default the file is ignored so local changes to building don't accidently get checked in. +.PARAMETER MultiTargets + List of targets to set as TFM platforms to build for. Possible values match those provided to the MSBuild property. + By default, uwp, wasdk, and wasm will included. +.PARAMETER ExcludeMultiTargets + List to exclude from build. Possible values match those provided to the MSBuild property. + By default, none will excluded. .EXAMPLE - C:\PS> .\UseTargetFrameworks winappsdk - Build targets for just the WindowsAppSDK. + C:\PS> .\UseTargetFrameworks wasdk + Build TFMs for only the Windows App SDK. .NOTES Author: Windows Community Toolkit Labs Team Date: April 8, 2022 #> Param ( [Parameter(HelpMessage = "The target frameworks to enable.")] - [ValidateSet('all', 'all-uwp', 'all-wasdk', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] - [string[]]$targets = @('uwp', 'winappsdk', 'wasm') # default settings + [ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] + [Alias("mt")] + [string[]]$MultiTargets = @('uwp', 'wasdk', 'wasm'), # default settings + + [Parameter(HelpMessage = "The target frameworks to disable.")] + [ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')] + [string[]]$ExcludeMultiTargets = @() # default settings ) $UwpTfm = "UwpTargetFramework"; @@ -39,71 +43,67 @@ $NetstandardTfm = "DotnetStandardCommonTargetFramework"; $fileContents = Get-Content -Path $PSScriptRoot/AvailableTargetFrameworks.props -$allTargetFrameworks = @( - $WasmTfm, - $UwpTfm, - $WinAppSdkTfm, - $WpfTfm, - $GtkTfm, - $macOSTfm, - $iOSTfm, - $DroidTfm, - $NetstandardTfm -); - -$desiredTfmValues = @(); - -if ($targets.Contains("all")) { - $desiredTfmValues = $allTargetFrameworks; +# 'all' represents many '$MultiTargets' values +if ($MultiTargets.Contains("all")) { + $MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard') } -if ($targets.Contains("all-uwp")) { - $desiredTfmValues = $allTargetFrameworks.Replace($UwpTfm, ""); +# Exclude as needed +foreach ($excluded in $ExcludeMultiTargets) { + $MultiTargets = $MultiTargets.Where({ $_ -ne $excluded }); } -if ($targets.Contains("all-wasdk")) { - $desiredTfmValues = $allTargetFrameworks.Replace($WinAppSdkTfm, ""); -} +Write-Output "Setting enabled TargetFrameworks: $MultiTargets" + +$desiredTfmValues = @(); -if ($targets.Contains("wasm")) { +if ($MultiTargets.Contains("wasm")) { $desiredTfmValues += $WasmTfm; } -if ($targets.Contains("uwp")) { +if ($MultiTargets.Contains("uwp")) { $desiredTfmValues += $UwpTfm; } -if ($targets.Contains("wasdk")) { +if ($MultiTargets.Contains("wasdk")) { $desiredTfmValues += $WinAppSdkTfm; } -if ($targets.Contains("wpf")) { +if ($MultiTargets.Contains("wpf")) { $desiredTfmValues += $WpfTfm; } -if ($targets.Contains("linuxgtk")) { +if ($MultiTargets.Contains("linuxgtk")) { $desiredTfmValues += $GtkTfm; } -if ($targets.Contains("macos")) { +if ($MultiTargets.Contains("macos")) { $desiredTfmValues += $macOSTfm; } -if ($targets.Contains("ios")) { +if ($MultiTargets.Contains("ios")) { $desiredTfmValues += $iOSTfm; } -if ($targets.Contains("android")) { +if ($MultiTargets.Contains("android")) { $desiredTfmValues += $DroidTfm; } -if ($targets.Contains("netstandard")) { +if ($MultiTargets.Contains("netstandard")) { $desiredTfmValues += $NetstandardTfm; } -Write-Output "Setting enabled TargetFrameworks: $targets" - -$targetFrameworksToRemove = $allTargetFrameworks.Where({ -not $desiredTfmValues.Contains($_) }) +$targetFrameworksToRemove = @( + $WasmTfm, + $UwpTfm, + $WinAppSdkTfm, + $WpfTfm, + $GtkTfm, + $macOSTfm, + $iOSTfm, + $DroidTfm, + $NetstandardTfm +).Where({ -not $desiredTfmValues.Contains($_) }) $targetFrameworksToRemoveRegexPartial = $targetFrameworksToRemove -join "|"; diff --git a/ProjectHeads/AllComponents/Tests.WinAppSdk/CommunityToolkit.Tests.WinAppSdk.csproj b/ProjectHeads/AllComponents/Tests.Wasdk/CommunityToolkit.Tests.Wasdk.csproj similarity index 100% rename from ProjectHeads/AllComponents/Tests.WinAppSdk/CommunityToolkit.Tests.WinAppSdk.csproj rename to ProjectHeads/AllComponents/Tests.Wasdk/CommunityToolkit.Tests.Wasdk.csproj diff --git a/ProjectHeads/AllComponents/Tests.WinAppSdk/Package.appxmanifest b/ProjectHeads/AllComponents/Tests.Wasdk/Package.appxmanifest similarity index 100% rename from ProjectHeads/AllComponents/Tests.WinAppSdk/Package.appxmanifest rename to ProjectHeads/AllComponents/Tests.Wasdk/Package.appxmanifest diff --git a/ProjectHeads/AllComponents/Tests.WinAppSdk/Properties/launchSettings.json b/ProjectHeads/AllComponents/Tests.Wasdk/Properties/launchSettings.json similarity index 100% rename from ProjectHeads/AllComponents/Tests.WinAppSdk/Properties/launchSettings.json rename to ProjectHeads/AllComponents/Tests.Wasdk/Properties/launchSettings.json diff --git a/ProjectHeads/AllComponents/Tests.WinAppSdk/app.manifest b/ProjectHeads/AllComponents/Tests.Wasdk/app.manifest similarity index 100% rename from ProjectHeads/AllComponents/Tests.WinAppSdk/app.manifest rename to ProjectHeads/AllComponents/Tests.Wasdk/app.manifest diff --git a/ProjectHeads/AllComponents/WinAppSdk/CommunityToolkit.App.WinAppSdk.csproj b/ProjectHeads/AllComponents/Wasdk/CommunityToolkit.App.Wasdk.csproj similarity index 100% rename from ProjectHeads/AllComponents/WinAppSdk/CommunityToolkit.App.WinAppSdk.csproj rename to ProjectHeads/AllComponents/Wasdk/CommunityToolkit.App.Wasdk.csproj diff --git a/ProjectHeads/AllComponents/WinAppSdk/Package.appxmanifest b/ProjectHeads/AllComponents/Wasdk/Package.appxmanifest similarity index 100% rename from ProjectHeads/AllComponents/WinAppSdk/Package.appxmanifest rename to ProjectHeads/AllComponents/Wasdk/Package.appxmanifest diff --git a/ProjectHeads/AllComponents/WinAppSdk/Properties/launchSettings.json b/ProjectHeads/AllComponents/Wasdk/Properties/launchSettings.json similarity index 100% rename from ProjectHeads/AllComponents/WinAppSdk/Properties/launchSettings.json rename to ProjectHeads/AllComponents/Wasdk/Properties/launchSettings.json diff --git a/ProjectHeads/AllComponents/WinAppSdk/app.manifest b/ProjectHeads/AllComponents/Wasdk/app.manifest similarity index 100% rename from ProjectHeads/AllComponents/WinAppSdk/app.manifest rename to ProjectHeads/AllComponents/Wasdk/app.manifest