Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ jobs:
# WinUI 2 not supported on wasdk
- winui: 2
multitarget: wasdk
# WinUI 2 not supported on wasm (Uno 6.x dropped Uno.UI)
- winui: 2
multitarget: wasm
# WinUI 3 not supported on uwp
- winui: 3
multitarget: uwp
Expand Down
14 changes: 7 additions & 7 deletions Build-Toolkit-Components.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
Date: 2/19/2024
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'), # default settings
[ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]

[ValidateSet('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$ExcludeMultiTargets = @(), # default settings

[Alias("c")]
Expand Down Expand Up @@ -97,19 +97,19 @@ Param (


if ($MultiTargets -eq 'all') {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')
}

if ($null -eq $ExcludeMultiTargets)
{
$ExcludeMultiTargets = @()
}

# Both uwp and wasdk share a targetframework. Both cannot be enabled at once.
# If both are supplied, remove one based on WinUIMajorVersion.
# WinUI 2 only builds native UWP (Uno.UI dropped in Uno 6).
# WinUI 3 excludes UWP. Both uwp and wasdk share a targetframework and cannot be enabled at once.
if ($WinUIMajorVersion -eq 2)
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk' + 'wasm' + 'macos' + 'ios' + 'android'
}

if ($WinUIMajorVersion -eq 3)
Expand Down
29 changes: 13 additions & 16 deletions Build-Toolkit-Gallery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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: 'wpf', 'linuxgtk', 'macos', 'ios', and 'android'. Run uno-check to install the required workloads.
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 Heads
The heads to include in the build. Default is 'Uwp', 'Wasdk', 'Wasm'.
Expand Down Expand Up @@ -46,11 +46,11 @@
Date: 2/19/2024
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasdk', 'wasm'), # default settings
[ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]

[ValidateSet('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$ExcludeMultiTargets = @(), # default settings

[ValidateSet('all', 'Uwp', 'Wasdk', 'Wasm', 'Tests.Uwp', 'Tests.Wasdk')]
Expand Down Expand Up @@ -87,22 +87,19 @@ if ($null -eq $ExcludeMultiTargets)
$ExcludeMultiTargets = @()
}

# Both uwp and wasdk share a targetframework. Both cannot be enabled at once.
# If both are supplied, remove one based on WinUIMajorVersion.
if ($MultiTargets.Contains('uwp') -and $MultiTargets.Contains('wasdk'))
# WinUI 2 only builds native UWP (Uno.UI dropped in Uno 6).
# WinUI 3 excludes UWP. Both uwp and wasdk share a targetframework and cannot be enabled at once.
if ($WinUIMajorVersion -eq 2)
{
if ($WinUIMajorVersion -eq 2)
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk' + 'wasm' + 'macos' + 'ios' + 'android'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}

if ($MultiTargets -eq 'all') {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')
}

if ($ExcludeMultiTargets) {
Expand Down
25 changes: 11 additions & 14 deletions GenerateAllSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
Date: April 27, 2022
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'),

[ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[ValidateSet('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$ExcludeMultiTargets = @(), # default settings

[Alias("c")]
Expand All @@ -59,26 +59,23 @@ Param (
)

if ($MultiTargets.Contains('all')) {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')
}

if ($null -eq $ExcludeMultiTargets)
{
$ExcludeMultiTargets = @()
}

# Both uwp and wasdk share a targetframework. Both cannot be enabled at once.
# If both are supplied, remove one based on WinUIMajorVersion.
if ($MultiTargets.Contains('uwp') -and $MultiTargets.Contains('wasdk'))
# WinUI 2 only builds native UWP (Uno.UI dropped in Uno 6).
# WinUI 3 excludes UWP. Both uwp and wasdk share a targetframework and cannot be enabled at once.
if ($WinUIMajorVersion -eq 2)
{
if ($WinUIMajorVersion -eq 2)
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk' + 'wasm' + 'macos' + 'ios' + 'android'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}

$MultiTargets = $MultiTargets | Where-Object { $_ -notin $ExcludeMultiTargets }
Expand Down
23 changes: 10 additions & 13 deletions GenerateSingleSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Date: Feb 9, 2023
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android')]
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'),

Expand Down Expand Up @@ -98,26 +98,23 @@ if (-not (Test-Path "$componentPath/src" -PathType Container))
# -----------------

if ($MultiTargets.Contains('all')) {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android')
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android')
}

if ($null -eq $ExcludeMultiTargets)
{
$ExcludeMultiTargets = @()
}

# Both uwp and wasdk share a targetframework. Both cannot be enabled at once.
# If both are supplied, remove one based on WinUIMajorVersion.
if ($MultiTargets.Contains('uwp') -and $MultiTargets.Contains('wasdk'))
# WinUI 2 only builds native UWP (Uno.UI dropped in Uno 6).
# WinUI 3 excludes UWP. Both uwp and wasdk share a targetframework and cannot be enabled at once.
if ($WinUIMajorVersion -eq 2)
{
if ($WinUIMajorVersion -eq 2)
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}
$ExcludeMultiTargets = $ExcludeMultiTargets + 'wasdk' + 'wasm' + 'macos' + 'ios' + 'android'
}
else
{
$ExcludeMultiTargets = $ExcludeMultiTargets + 'uwp'
}

$MultiTargets = $MultiTargets | Where-Object { $_ -notin $ExcludeMultiTargets }
Expand Down
4 changes: 0 additions & 4 deletions MultiTarget/AvailableTargetFrameworks.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@
<WinAppSdkTargetFrameworks Condition="'$(WinAppSdkTargetFrameworks)' == ''">net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;</WinAppSdkTargetFrameworks>

<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net9.0;</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net9.0;</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net9.0;</WpfHeadTargetFramework>

<AndroidLibTargetFrameworks Condition="'$(AndroidLibTargetFrameworks)' == ''">net9.0-android;</AndroidLibTargetFrameworks>
<MacOSLibTargetFrameworks Condition="'$(MacOSLibTargetFrameworks)' == ''">net9.0-maccatalyst;</MacOSLibTargetFrameworks>
<iOSLibTargetFrameworks Condition="'$(iOSLibTargetFrameworks)' == ''">net9.0-ios;</iOSLibTargetFrameworks>

<!-- Used for comparison to current TargetFramework -->
<LinuxLibTargetFrameworks Condition="'$(LinuxLibTargetFrameworks)' == ''">net9.0;</LinuxLibTargetFrameworks>
<WasmLibTargetFrameworks Condition="'$(WasmLibTargetFrameworks)' == ''">net9.0;</WasmLibTargetFrameworks>
<WpfLibTargetFrameworks Condition="'$(WpfLibTargetFrameworks)' == ''">net9.0;</WpfLibTargetFrameworks>

<!-- Used for defining TargetFramework under platforms that need it -->
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0;</DotnetStandardCommonTargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion MultiTarget/Defaults.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wasm;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions MultiTarget/DefinedConstants.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<DefineConstants Condition="'$(IsDroid)' == 'true'">$(DefineConstants);__ANDROID__;</DefineConstants>
<DefineConstants Condition="'$(IsiOS)' == 'true'">$(DefineConstants);__IOS__;</DefineConstants>
<DefineConstants Condition="'$(IsMacOS)' == 'true'">$(DefineConstants);__MACOS__;</DefineConstants>
<DefineConstants Condition="'$(IsWpf)' == 'true'">$(DefineConstants);HAS_UNO_SKIA;__SKIA__;WINDOWS_WPF;</DefineConstants>
<DefineConstants Condition="'$(IsGtk)' == 'true'">$(DefineConstants);HAS_UNO_SKIA;__SKIA__;__GTK__;</DefineConstants>

<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">$(DefineConstants);NET9_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">$(DefineConstants);NET8_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">$(DefineConstants);NET7_0_OR_GREATER</DefineConstants>
Expand Down
6 changes: 3 additions & 3 deletions MultiTarget/EnabledTargetFrameworks.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('wasdk')) == 'true' AND $(AvailableMultiTargets.Contains('wasdk')) == 'true'">$(TargetFrameworks);$(WinAppSdkTargetFrameworks)</TargetFrameworks>

<!--
TargetFrameworks for WasmLibTargetFrameworks, WpfLibTargetFrameworks, and LinuxLibTargetFrameworks all use the same value.
TargetFrameworks for WasmLibTargetFrameworks use DotnetCommonTargetFramework.
Duplicate values can't be removed during the evaluation phase without breaking things, so we use a single value for all that need it.
-->
<IsNetCommonMultiTargetEnabled Condition="$(EnabledMultiTargets.Contains('wasm')) == 'true' OR $(EnabledMultiTargets.Contains('wpf')) == 'true' OR $(EnabledMultiTargets.Contains('linuxgtk')) == 'true'">true</IsNetCommonMultiTargetEnabled>
<IsNetCommonMultiTargetAvailable Condition="$(AvailableMultiTargets.Contains('wasm')) == 'true' OR $(AvailableMultiTargets.Contains('wpf')) == 'true' OR $(AvailableMultiTargets.Contains('linuxgtk')) == 'true'">true</IsNetCommonMultiTargetAvailable>
<IsNetCommonMultiTargetEnabled Condition="$(EnabledMultiTargets.Contains('wasm')) == 'true'">true</IsNetCommonMultiTargetEnabled>
<IsNetCommonMultiTargetAvailable Condition="$(AvailableMultiTargets.Contains('wasm')) == 'true'">true</IsNetCommonMultiTargetAvailable>
<TargetFrameworks Condition="$(IsNetCommonMultiTargetEnabled) == 'true' AND $(IsNetCommonMultiTargetAvailable) == 'true'">$(TargetFrameworks);$(DotnetCommonTargetFramework)</TargetFrameworks>

<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('macos')) == 'true' AND $(AvailableMultiTargets.Contains('macos')) == 'true'">$(TargetFrameworks);$(MacOSLibTargetFrameworks)</TargetFrameworks>
Expand Down
4 changes: 2 additions & 2 deletions MultiTarget/Filter-Supported-Components.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Date: 6/6/2025
#>
Param (
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[ValidateSet('all', 'wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[Parameter(Mandatory=$true)]
[string[]]$MultiTargets,
Expand All @@ -32,7 +32,7 @@ Param (
)

if ($MultiTargets -eq 'all') {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')
}

$supportedComponents = @();
Expand Down
4 changes: 2 additions & 2 deletions MultiTarget/GenerateAllProjectReferences.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Param (

[Parameter(HelpMessage = "Only projects that support these targets will have references generated for use by deployable heads.")]
[Alias("mt")]
[ValidateSet('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$MultiTargets = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard"),
[ValidateSet('wasm', 'uwp', 'wasdk', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$MultiTargets = @("uwp", "wasdk", "wasm", "macos", "ios", "android", "netstandard"),

[Parameter(HelpMessage = "The names of the components to generate references for. Defaults to all components.")]
[string[]]$Components = @("all"),
Expand Down
8 changes: 3 additions & 5 deletions MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Param (
[string]$projectRootPlaceholder = "[ProjectRoot]",

[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")]
[ValidateSet("uwp", "wasdk", "wasm", "macos", "ios", "android", "netstandard")]
[Alias("mt")]
[string[]] $MultiTargets = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard")
[string[]] $MultiTargets = @("uwp", "wasdk", "wasm", "macos", "ios", "android", "netstandard")
)

if ($projectPath.EndsWith(".projitems")) {
Expand Down Expand Up @@ -74,7 +74,7 @@ function ShouldMultiTargetMsBuildValue([string] $target) {
return $(ShouldMultiTarget $target).ToString().ToLower()
}

$targeted = @("uwp", "wasdk", "wpf", "wasm", "linuxgtk", "macos", "ios", "android", "netstandard").Where({ ShouldMultiTarget $_ })
$targeted = @("uwp", "wasdk", "wasm", "macos", "ios", "android", "netstandard").Where({ ShouldMultiTarget $_ })

if ($targeted.Count -gt 0) {
Write-Host "Generating project references for $([System.IO.Path]::GetFileNameWithoutExtension($projectFileName)): $($targeted -Join ', ')"
Expand All @@ -83,8 +83,6 @@ if ($targeted.Count -gt 0) {
$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")'";
Expand Down
2 changes: 0 additions & 2 deletions MultiTarget/MultiTargetAwareProjectReference.props.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<When Condition="($(IsWasm) == 'true' AND [CanTargetWasm] == 'true') OR
($(IsUwp) == 'true' AND [CanTargetUwp] == 'true') OR
($(IsWinAppSdk) == 'true' AND [CanTargetWasdk] == 'true') OR
($(IsWpf) == 'true' AND [CanTargetWpf] == 'true') OR
($(IsGtk) == 'true' AND [CanTargetLinuxGtk] == 'true') OR
($(IsMacOS) == 'true' AND [CanTargetMacOS] == 'true') OR
($(IsiOS) == 'true' AND [CanTargetiOS] == 'true') OR
($(IsDroid) == 'true' AND [CanTargetDroid] == 'true') OR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<Import Condition="($(IsWasm) == 'true' AND 'false' == 'true') OR
($(IsUwp) == 'true' AND 'false' == 'true') OR
($(IsWinAppSdk) == 'true' AND 'true' == 'true') OR
($(IsWpf) == 'true' AND 'false' == 'true') OR
($(IsGtk) == 'true' AND 'false' == 'true') OR
($(IsMacOS) == 'true' AND 'false' == 'true') OR
($(IsiOS) == 'true' AND 'false' == 'true') OR
($(IsDroid) == 'true' AND 'false' == 'true') OR
Expand Down
Loading
Loading