Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
69 changes: 48 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,26 @@ jobs:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
matrix:
winui: [2, 3]
multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'win32', 'linux', 'macos', 'ios', 'android']
exclude:
# WinUI 2 not supported on wasdk
- winui: 2
multitarget: wasdk
# WinUI 3 not supported on uwp
- winui: 3
multitarget: uwp
# wpf is the Uno 5 Skia WPF head, which Uno 6 replaced with win32
- winui: 3
multitarget: wpf
# win32 is the Uno 6 Skia desktop head, which has no Uno 5 equivalent
- winui: 2
multitarget: win32
include:
# On WinUI 3 the Uno.Sdk head replaces the classic Wasm head, so it rides on the
# existing wasm job as a flag rather than a fake entry in the multitarget axis.
- winui: 3
multitarget: wasm
unoSdkHead: true

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -112,9 +124,9 @@ jobs:
run: dotnet tool restore

- name: Run Uno Check to Install Dependencies
if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' }}
if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linux' && matrix.multitarget != 'wpf' && matrix.multitarget != 'win32' && !matrix.unoSdkHead }}
run: >
dotnet tool run uno-check
dotnet tool run uno-check
--ci
--target ${{ matrix.multitarget }}
--fix
Expand All @@ -125,18 +137,26 @@ jobs:
--skip vswin
--verbose

# The Uno.Sdk head builds desktop/browserwasm/android (iOS is filtered on
# Windows). Install the matching workloads directly instead of uno-check.
- name: Install .NET workloads (Uno.Sdk head)
if: ${{ matrix.unoSdkHead }}
run: dotnet workload install wasm-tools android ios maui

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.9,)'

# Generate full solution with all projects (sample gallery heads, components, tests)
# The Uno.Sdk head also covers Windows desktop, so it asks for win32 alongside wasm.
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests
working-directory: ./
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }}${{ matrix.unoSdkHead && ',win32 -IncludeUnoSdkHead' || '' }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop

# Build solution
- name: MSBuild
if: ${{ !matrix.unoSdkHead }}
run: >
msbuild.exe /restore /nowarn:MSB4011
/p:Configuration=Release
Expand All @@ -145,6 +165,12 @@ jobs:
/v:${{ env.MSBUILD_VERBOSITY }}
CommunityToolkit.AllComponents.sln

# The Uno.Sdk head is a single project covering desktop/browserwasm/android
# (iOS is filtered on Windows); build it directly with dotnet.
- name: Build Uno.Sdk head
if: ${{ matrix.unoSdkHead }}
run: dotnet build tooling/ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj -p:Configuration=Release ${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }}

# Run tests
- name: Setup VSTest Path
uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
Expand Down Expand Up @@ -424,7 +450,7 @@ jobs:
--api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }}
--skip-duplicate

wasm-linux:
uno-linux:
runs-on: ubuntu-latest

steps:
Expand All @@ -439,6 +465,12 @@ jobs:
with:
global-json-file: global.json

# iOS/maccatalyst aren't installable on Linux (Uno.Sdk filters those TFMs
# there). android + wasm-tools are both required: even a single-TFM build
# restores all of the head's TargetFrameworks, validating net9.0-android.
- name: Install .NET workloads
run: dotnet workload install android wasm-tools

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
Expand All @@ -447,31 +479,26 @@ jobs:
- name: Restore dotnet tools
run: dotnet tool restore

- name: Enable WASM TargetFrameworks
shell: pwsh
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
run: ./UseTargetFrameworks.ps1 wasm

# Generate the full solution with the Uno.Sdk gallery head, components and tests
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
run: ./tooling/GenerateAllSolution.ps1 -MultiTargets wasm,linux -IncludeUnoSdkHead -WinUIMajorVersion 3${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}

- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build
- name: Build Uno head (browserwasm)
shell: pwsh
working-directory: ./
run: dotnet build tooling/ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj -f net9.0-browserwasm -p:Configuration=Release

# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
- name: dotnet build
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
run: dotnet build /r /bl -v:${{ env.MSBUILD_VERBOSITY }}

# TODO: Do we want to run tests here? Can we do that on linux easily?
- 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

2 changes: 1 addition & 1 deletion components/Animations/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ public TValue? To
/// <summary>
/// Identifies the <seealso cref="To"/> dependency property.
/// </summary>
// typeof(TValue?) is only used as dependency property metadata, not for reflective construction.
#pragma warning disable IL2087
public static readonly DependencyProperty ToProperty = DependencyProperty.Register(
nameof(To),
typeof(TValue?),
typeof(Animation<TValue, TKeyFrame>),
new PropertyMetadata(null));
#pragma warning restore IL2087

/// <summary>
/// Gets or sets the optional starting value for the animation.
Expand All @@ -48,11 +51,14 @@ public TValue? From
/// <summary>
/// Identifies the <seealso cref="From"/> dependency property.
/// </summary>
// typeof(TValue?) is only used as dependency property metadata, not for reflective construction.
#pragma warning disable IL2087
public static readonly DependencyProperty FromProperty = DependencyProperty.Register(
nameof(From),
typeof(TValue?),
typeof(Animation<TValue, TKeyFrame>),
new PropertyMetadata(null));
#pragma warning restore IL2087

/// <summary>
/// Gets or sets the optional keyframe collection for the current animation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ public TValue? Value
/// <summary>
/// Identifies the <seealso cref="Value"/> dependency property.
/// </summary>
// typeof(TValue?) is only used as dependency property metadata, not for reflective construction.
#pragma warning disable IL2087
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
nameof(Value),
typeof(TValue?),
typeof(KeyFrame<TValue, TKeyFrame>),
new PropertyMetadata(null));
#pragma warning restore IL2087

/// <summary>
/// Gets or sets the optional expression for the current keyframe.
Expand Down
3 changes: 3 additions & 0 deletions components/Behaviors/src/Headers/HeaderBehaviorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ private void ScrollViewer_GotFocus(object sender, RoutedEventArgs e)
}
else
{
// Obsolete on WinUI 3/Uno, but required as a fallback where XamlRoot is unavailable (e.g. UWP).
#pragma warning disable CS0618
focusedElement = FocusManager.GetFocusedElement()!;
#pragma warning restore CS0618
}

// To prevent Popups (Flyouts...) from triggering the autoscroll, we check if the focused element has a valid parent.
Expand Down
2 changes: 1 addition & 1 deletion components/Behaviors/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Collections/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/ColorPicker/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Converters/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions components/DeveloperTools/src/FocusTracker/FocusTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ private void Start()
}
else
{
// Obsolete on WinUI 3/Uno, but required as a fallback where XamlRoot is unavailable (e.g. UWP).
#pragma warning disable CS0618
if (FocusManager.GetFocusedElement() is FrameworkElement element)
#pragma warning restore CS0618
{
FocusOnControl(element);
}
Expand Down
2 changes: 1 addition & 1 deletion components/DeveloperTools/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Extensions/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/HeaderedControls/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Helpers/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/LayoutTransformControl/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/MetadataControl/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Primitives/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/RangeSelector/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Segmented/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions components/Segmented/src/Segmented/Segmented.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ private bool MoveFocus(int adjustment)
}
else
{
// Obsolete on WinUI 3/Uno, but required as a fallback where XamlRoot is unavailable (e.g. UWP).
#pragma warning disable CS0618
return FocusManager.GetFocusedElement() as SegmentedItem;
#pragma warning restore CS0618
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/SettingsControls/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions components/SettingsControls/src/SettingsCard/SettingsCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,10 @@ private void CheckVerticalSpacingState(VisualState s)
}
else
{
// Obsolete on WinUI 3/Uno, but required as a fallback where XamlRoot is unavailable (e.g. UWP).
#pragma warning disable CS0618
return FocusManager.GetFocusedElement() as FrameworkElement;
#pragma warning restore CS0618
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/Sizers/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/TabbedCommandBar/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion components/TokenizingTextBox/src/MultiTarget.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
-->
<MultiTarget>uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android;</MultiTarget>
<MultiTarget>uwp;wasdk;wpf;win32;wasm;linux;macos;ios;android;</MultiTarget>
</PropertyGroup>
</Project>
Loading
Loading