Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d01dc7c
Update to Uno 6.x, drop Uno.UI
MartinZikmund Feb 17, 2026
e70d8d9
Update to .NET 10 compatible Uno.WinUI version
MartinZikmund Feb 17, 2026
b17dd30
chore: Keep .NET 9 targets
MartinZikmund Feb 17, 2026
566fc13
Restore Uno 5.x for UWP targeting
MartinZikmund Feb 20, 2026
e213dce
Adjustments
MartinZikmund Feb 20, 2026
54afbc3
Undo change
MartinZikmund Feb 20, 2026
0cbae24
fix: Ensure WASM head can start up
MartinZikmund Mar 16, 2026
608080f
chore: Adjust host builder for Uno 6.x
MartinZikmund Mar 16, 2026
c052b37
Add Uno.Sdk project head
MartinZikmund Feb 24, 2026
8503cf3
Adjust scripts and workflows
MartinZikmund Feb 24, 2026
f4f33e6
Adjust CI to build all Uno.Sdk targets
MartinZikmund Feb 25, 2026
93b31a4
Pick correct dependencies for Uno
MartinZikmund Feb 25, 2026
4e11289
Adjust DependencyVariant
MartinZikmund Feb 25, 2026
588a976
Adjust Markdown sample
MartinZikmund Feb 25, 2026
7b8fb29
Add missing uno prop
MartinZikmund Feb 25, 2026
039b688
Add icon, fully qualify App
MartinZikmund Feb 26, 2026
54b711e
Fully qualify on all components
MartinZikmund Feb 26, 2026
389f7b2
Add missing webmanifest
MartinZikmund Feb 26, 2026
ce07079
Fully qualify iOS
MartinZikmund Feb 26, 2026
9ba4c3e
Disable AOT on Android
MartinZikmund Feb 26, 2026
5457779
Rename pipeline
MartinZikmund Feb 26, 2026
8df4381
Fix uno-linux CI job: drop iOS/maui workloads on Linux
MartinZikmund Jun 17, 2026
0ab40f3
Remove Windows-only setup-msbuild from uno-linux job
MartinZikmund Jun 17, 2026
ed352f7
Fix workload band mismatch in uno-linux job
MartinZikmund Jun 17, 2026
01a12c0
Add license headers to Uno head platform files
MartinZikmund Jun 17, 2026
3b1e7d1
Make the Uno.Sdk head respect the requested -MultiTargets
MartinZikmund Jul 5, 2026
7e9ebc9
Make 'desktop' a first-class MultiTarget for the Uno.Sdk head
MartinZikmund Jul 6, 2026
8e7af1f
Stop using 'unosdk' as a fake multitarget in the CI matrix
MartinZikmund Sep 1, 2026
2a31505
Split the 'desktop' MultiTarget into win32, linux and macos
MartinZikmund Sep 1, 2026
3433dc5
Keep Mac Catalyst out of the WinUI 3 package surface
MartinZikmund Sep 1, 2026
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
76 changes: 67 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,26 @@ jobs:
with:
global-json-file: tooling/global.json

- name: Install .NET workloads
run: dotnet workload install wasm-tools

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info

- name: Copy props files to root
shell: pwsh
working-directory: ./
run: copy ./tooling/.github/workflows/config/* ./
run: |
copy ./tooling/.github/workflows/config/* ./
copy ./tooling/global.json ./

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Add project heads to ProjectTemplate
working-directory: ./${{ env.PROJECT_DIRECTORY }}
run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -IncludeUnoSdkHead -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

@Arlodotexe Arlodotexe Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiTargets imply the heads that need to be included when generating the solution, we don't need a separate switch parameter for it.

As example, if you request components that have UnoSdk-compatible MultiTargets supported and you also request to enable those same MultiTargets when generating the solution, then the UnoSdk head should be included implicitly without needing an explicit param flag/switch.

We do this on main in:

$allUsedMultiTargetPrefs = @()
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)
$usedMultiTargetPrefs = $multiTargetPrefs.Where({ $MultiTargets.Contains($_) });
$shouldReferenceInSolution = $usedMultiTargetPrefs.Count -gt 0
if ($shouldReferenceInSolution) {
Write-Output "Add component $componentPath to solution";
$allUsedMultiTargetPrefs += $usedMultiTargetPrefs
[void]$projects.Add(".\components\$($componentPath.BaseName)\src\*.csproj")
[void]$projects.Add(".\components\$($componentPath.BaseName)\samples\*.Samples.csproj")
[void]$projects.Add(".\components\$($componentPath.BaseName)\tests\*.shproj")
} else {
Write-Warning "Component $($componentPath.BaseName) doesn't MultiTarget any of $MultiTargets and won't be added to the solution.";
}
}
}
# Deployable sample gallery heads
# Only include heads for requested MultiTargets if components were included that use them.
# ===
# 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 $allUsedMultiTargetPrefs) {
# 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."
}
}

and

# All heads are included by default since they reside in the same folder as the component.
# Remove any heads that are not required for the solution.
# 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 = "$outputHeadsDir\**\*$csprojFileNamePartForMultiTarget.csproj";
if (Test-Path $path) {
# iterate the wildcards caught by $path
foreach ($foundItem in Get-ChildItem $path)
{
$projects = $projects + $foundItem.FullName
}
}
else {
Write-Warning "No project head could be found at $path for MultiTarget $multitarget. Skipping."
}
}

We'll want to do something similar here, having a dedicated parameter for this is an excess requirement that we can simplify by extending the method we already use to enable heads based on requested/supported multitargets.


# Build and use template for creating new experiments
- name: Build ProjectTemplate
Expand All @@ -149,6 +154,12 @@ jobs:
# WinUI 3 not supported on uwp
- winui: 3
multitarget: uwp
include:
# The Uno.Sdk head replaces the classic Wasm head on WinUI 3, so it rides on the
# existing wasm/winui3 job as a flag rather than a fake entry in the multitarget axis.

@Arlodotexe Arlodotexe Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very confused by the rationale for this comment, why would we need to explicitly define the behavior of switching between the classic wasm/winui2 and the modern wasm/winui3?

The multitarget system exists to abstract away this complexity and reduce the platform choice (native or uno) down to their actual deployment targets from the developer perspective.

Neither the consuming developer nor the CI matrix should have to manually activate Uno or switch around Uno complexity under the hood, our internals should handle this transparently.

E.g. -- If WinUI 2 + wasm is requested, it uses the classic WASM head. If WinUI 3 + wasm is asked for, it uses the newer Uno SDK head. These implementation details should not leak into parameters that make it to the CLI or CI, they're implied by the requested WinUI version and the user-requested + component-supported MultiTargets.

- winui: 3
multitarget: wasm
unoSdkHead: true

env:
HEADS_DIRECTORY: tooling/ProjectHeads
Expand Down Expand Up @@ -178,6 +189,10 @@ jobs:
with:
global-json-file: tooling/global.json

- name: Install .NET workloads
if: ${{ matrix.multitarget == 'wasm' }}
run: dotnet workload install wasm-tools ${{ matrix.unoSdkHead && 'android ios maui' || '' }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as https://github.com/CommunityToolkit/Tooling-Windows-Submodule/pull/305/changes#r3997101887, wondering if we can have uno-check do this for us like before, or if we really must do this manually.


- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
Expand All @@ -187,6 +202,7 @@ jobs:
working-directory: ./
run: |
copy ./tooling/.github/workflows/config/* ./
copy ./tooling/global.json ./
mkdir ./.config
copy ./tooling/.config/dotnet-tools.json ./.config/dotnet-tools.json
mkdir ./components
Expand Down Expand Up @@ -214,12 +230,24 @@ jobs:

- name: Add project heads to ${{ env.TEST_PROJECT_NAME }}
working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }}
run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -MultiTargets ${{ matrix.multitarget }} -winui ${{ matrix.winui }} -componentPath "${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }}"${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: >-
${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1
-MultiTargets ${{ matrix.multitarget }}
-winui ${{ matrix.winui }}
-componentPath "${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }}"
${{ matrix.unoSdkHead && ' -IncludeUnoSdkHead' || '' }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

- name: MSBuild
if: ${{ !matrix.unoSdkHead }}

@Arlodotexe Arlodotexe Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we clean up the unoSdkHead property per this comment, presumably we'll still need to build the Uno head with dotnet build instead of msbuild-- but I'm skeptical of that, because msbuild is what Visual Studio uses.

We need to double check that we're not making an excess/unnecessary change here, if we can build the Uno head in VS then it should also work via CLI with msbuild instead of dotnet and we won't need this line or L246-L250 below.

working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }}
run: msbuild.exe ${{ env.TEST_PROJECT_NAME }}.sln /restore /nowarn:MSB4011 -p:Configuration=Release /m ${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }} /v:${{ env.MSBUILD_VERBOSITY }}

- name: Build Uno head
if: ${{ matrix.unoSdkHead }}
working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }}
run: dotnet build heads/Uno/${{ env.TEST_PROJECT_NAME }}.Uno.csproj -p:Configuration=Release

# Run tests
- name: Setup VSTest Path
uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
Expand All @@ -246,10 +274,11 @@ jobs:
name: new-experiment-logs-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: ./**/*.*log

wasm-linux:
uno-linux:
runs-on: ubuntu-latest
env:
HEADS_DIRECTORY: tooling/ProjectHeads
PROJECT_DIRECTORY: tooling/ProjectTemplate
TEST_PROJECT_NAME: CiTestExp

steps:
Expand All @@ -264,6 +293,18 @@ jobs:
with:
global-json-file: tooling/global.json

# iOS/maccatalyst workloads aren't installable on Linux (Uno.Sdk
# auto-filters those TFMs there). android + wasm-tools are both
# required: even a `-f net9.0-browserwasm` build restores all of the
# head's TargetFrameworks, so the net9.0-android TFM's workload is
# validated during restore.
# Run from ./tooling so global.json scopes the install to the pinned
# SDK feature band; otherwise the workloads land on the runner's newer
# preinstalled SDK and the 9.0.x build can't see them (NETSDK1147).
- name: Install .NET workloads
working-directory: tooling
run: dotnet workload install android wasm-tools

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
Expand All @@ -273,6 +314,7 @@ jobs:
working-directory: ./
run: |
copy ./tooling/.github/workflows/config/* ./
copy ./tooling/global.json ./
mkdir ./.config
copy ./tooling/.config/dotnet-tools.json ./.config/dotnet-tools.json
mkdir ./components
Expand All @@ -294,20 +336,36 @@ jobs:
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -MultiTargets wasm
run: ./tooling/GenerateAllSolution.ps1 -IncludeUnoSdkHead${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -MultiTargets wasm,linux

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same -IncludeUnoSdkHead concern as above


- name: dotnet build
shell: pwsh
working-directory: ./
run: ./tooling/Build-Toolkit-Components.ps1 -Release -MultiTargets wasm ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -BinlogOutput ./ -EnableBinLogs' || '' }}

# TODO: Do we want to run tests here? Can we do that on linux easily?
run: ./tooling/Build-Toolkit-Components.ps1 -Release -MultiTargets wasm,linux ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -BinlogOutput ./ -EnableBinLogs' || '' }}

- name: Build Uno head (browserwasm)

@Arlodotexe Arlodotexe Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're running our custom scaffold + build script and then... building again?

Build-Toolkit-Components.ps1 above builds all components individually, but then your invocations below to build the Uno gallery heads are building all components a second then third time.

This looks like an excess unexpected change. Presumably it's here so that we can make sure the Uno heads build on Linux and not just the components, but it's building the components multiple times and building every component at least one more time than it strictly needs to (looks like twice is minimum, currently 3x).

Since the existing Build-Toolkit-Components.ps1 script is only being invoked here to make sure project references are generated and such so that the heads can build, I recommend that instead we make sure that our Build-Toolkit-Gallery.ps1 script is capable of building the uno-specific multitargets on Linux and that we use that here instead.

This script generates project references and builds the head you ask for based solely on the requested WinUI version and the requested MultiTargets in the same manner described in my comment above.

Using Build-Toolkit-Gallery.ps1 instead of Build-Toolkit-Components.ps1 + manual csproj builds will:

  • Reduce unnecessary component rebuilds
  • Ensure that anyone (newcomers, CI, etc) can build the gallery head correctly knowing only the components, multitargets and winui version they want.

shell: pwsh
working-directory: ./
run: >-
dotnet build
tooling/ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj
-f net9.0-browserwasm
-p:Configuration=Release

- name: Build Uno head (desktop)
shell: pwsh
working-directory: ./
run: >-
dotnet build
tooling/ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj
-f net9.0-desktop
-p:Configuration=Release

- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: linux-logs
name: uno-linux-logs
path: ./**/*.*log


8 changes: 4 additions & 4 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', 'wpf', 'win32', 'linux', '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', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$ExcludeMultiTargets = @(), # default settings

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


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

if ($null -eq $ExcludeMultiTargets)
Expand Down
10 changes: 5 additions & 5 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: 'wpf', 'linux', 'macos', 'ios', and 'android'. 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', 'wpf', 'win32', 'linux', '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', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android', 'netstandard')]
[string[]]$ExcludeMultiTargets = @(), # default settings

[ValidateSet('all', 'Uwp', 'Wasdk', 'Wasm', 'Tests.Uwp', 'Tests.Wasdk')]
Expand Down Expand Up @@ -102,7 +102,7 @@ if ($MultiTargets.Contains('uwp') -and $MultiTargets.Contains('wasdk'))
}

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

if ($ExcludeMultiTargets) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#endif
#endif

#if HAS_UNO_WASM
#if HAS_UNO_WASM && !WINUI3
using Markdig;
using Uno.Foundation.Interop;
using Uno.UI.Runtime.WebAssembly;
Expand All @@ -27,7 +27,7 @@ namespace CommunityToolkit.App.Shared.Renderers;
/// <summary>
/// Provide an abstraction around the Toolkit MarkdownTextBlock for both UWP and WinUI 3 in the same namespace (until 8.0) as well as a polyfill for WebAssembly/WASM.
/// </summary>
#if HAS_UNO_WASM
#if HAS_UNO_WASM && !WINUI3
[HtmlElement("div")]
public partial class MarkdownTextBlock : TextBlock
{
Expand Down
39 changes: 29 additions & 10 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', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android', 'netstandard')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'),
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk', 'win32'),

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

[Alias("c")]
Expand All @@ -54,12 +54,14 @@ Param (
[string[]]$ExcludeComponents,

[switch]$UseDiagnostics = $false,

[bool]$Launch = $true

[bool]$Launch = $true,

[switch]$IncludeUnoSdkHead = $false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

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

if ($null -eq $ExcludeMultiTargets)
Expand Down Expand Up @@ -150,11 +152,19 @@ foreach ($componentName in $Components) {

# Deployable sample gallery heads
# Only include heads for requested MultiTargets if components were included that use them.
# ===
# 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.
# ===
# These have no head project of their own - they're served by the unified Uno.Sdk head added below.
$unoSdkHeadMultiTargets = @('win32', 'linux', 'macos', 'ios', 'android')

foreach ($multitarget in $allUsedMultiTargetPrefs) {
if ($unoSdkHeadMultiTargets -contains $multitarget) {
continue
}

# When using the Uno.Sdk head, skip the traditional Wasm head (Uno.Sdk covers wasm for WinUI 3)
if ($multitarget -eq 'wasm' -and $IncludeUnoSdkHead) {
continue
}

# capitalize first letter, avoid case sensitivity issues on linux
$csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower()

Expand All @@ -168,6 +178,15 @@ foreach ($multitarget in $allUsedMultiTargetPrefs) {
}
}

if ($IncludeUnoSdkHead) {
$unoHeadPath = "./tooling/ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj"
if (Test-Path $unoHeadPath) {
[void]$projects.Add($unoHeadPath)
} else {
Write-Warning "Uno.Sdk head project not found at $unoHeadPath."
}
}

if ($UseDiagnostics.IsPresent)
{
$sdkoptions = "-d"
Expand Down
33 changes: 28 additions & 5 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', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android')]
[Alias("mt")]
[string[]]$MultiTargets = @('uwp', 'wasm', 'wasdk'),

Expand All @@ -49,7 +49,9 @@ Param (
[string]$componentPath,

[Parameter(HelpMessage = "Add extra diagnostic output to slngen generator.")]
[switch]$UseDiagnostics = $false
[switch]$UseDiagnostics = $false,

[switch]$IncludeUnoSdkHead = $false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

if ($null -ne $Env:Path -and $Env:Path.ToLower().Contains("msbuild") -eq $false) {
Expand Down Expand Up @@ -98,7 +100,7 @@ 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', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android')
}

if ($null -eq $ExcludeMultiTargets)
Expand Down Expand Up @@ -188,9 +190,19 @@ Write-Output "Generating solution for $componentName in $generatedSolutionFilePa

# All heads are included by default since they reside in the same folder as the component.
# Remove any heads that are not required for the solution.
# 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.
# These have no head project of their own - they're served by the unified Uno.Sdk head added below.
$unoSdkHeadMultiTargets = @('win32', 'linux', 'macos', 'ios', 'android')

foreach ($multitarget in $MultiTargets) {
if ($unoSdkHeadMultiTargets -contains $multitarget) {
continue
}

# When using the Uno.Sdk head, skip the traditional Wasm head (Uno.Sdk covers wasm for WinUI 3)
if ($multitarget -eq 'wasm' -and $IncludeUnoSdkHead) {
continue
}

# capitalize first letter, avoid case sensitivity issues on linux
$csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower()

Expand All @@ -208,6 +220,17 @@ foreach ($multitarget in $MultiTargets) {
}
}

if ($IncludeUnoSdkHead) {
$unoHeadPath = "$outputHeadsDir\Uno\*Uno.csproj"
if (Test-Path $unoHeadPath) {
foreach ($foundItem in Get-ChildItem $unoHeadPath) {
$projects = $projects + $foundItem.FullName
}
} else {
Write-Warning "Uno.Sdk head project not found at $unoHeadPath."
}
}

# Include common dependencies required for solution to build
$projects = $projects + "$PSScriptRoot\CommunityToolkit.App.Shared\**\*.*proj"
$projects = $projects + "$PSScriptRoot\CommunityToolkit.Tests.Shared\**\*.*proj"
Expand Down
Loading
Loading