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
67 changes: 47 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ 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', 'unosdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
exclude:
# WinUI 2 not supported on wasdk
- winui: 2
multitarget: wasdk
# WinUI 3 not supported on uwp
- winui: 3
multitarget: uwp
# WinUI 3 wasm is covered by the Uno.Sdk head (unosdk)
- winui: 3
multitarget: wasm
# Uno.Sdk head is WinUI 3 only
- winui: 2
multitarget: unosdk

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -112,9 +118,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 != 'linuxgtk' && matrix.multitarget != 'wpf' && matrix.multitarget != 'unosdk' }}
run: >
dotnet tool run uno-check
dotnet tool run uno-check
--ci
--target ${{ matrix.multitarget }}
--fix
Expand All @@ -125,18 +131,32 @@ 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.multitarget == 'unosdk' }}
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)
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests
if: ${{ matrix.multitarget != 'unosdk' }}
working-directory: ./
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop

# The Uno.Sdk head covers wasm (browserwasm) for WinUI 3; generate with it included
- name: Generate solution with Uno.Sdk gallery, components and tests
if: ${{ matrix.multitarget == 'unosdk' }}
working-directory: ./
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets wasm -IncludeUnoSdkHead -WinUIMajorVersion 3${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop

# Build solution
- name: MSBuild
if: ${{ matrix.multitarget != 'unosdk' }}
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.multitarget == 'unosdk' }}
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 -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

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
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
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ private bool MoveFocusAndSelection(MoveDirection direction)
}
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 TokenizingTextBoxItem;
#pragma warning restore CS0618
}
}

Expand Down
3 changes: 3 additions & 0 deletions components/TokenizingTextBox/src/TokenizingTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ private object GetFocusedElement()
}
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()!;
#pragma warning restore CS0618
}
}

Expand Down
2 changes: 1 addition & 1 deletion tooling
Submodule tooling updated 66 files
+73 −11 .github/workflows/build.yml
+1 −1 Build-Toolkit-Components.ps1
+1 −1 Build-Toolkit-Gallery.ps1
+2 −2 CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs
+18 −2 GenerateAllSolution.ps1
+19 −1 GenerateSingleSolution.ps1
+31 −2 GenerateVSCodeLaunchConfig.ps1
+10 −0 Install-WindowsSdk.ps1
+1 −1 MultiTarget/AvailableTargetFrameworks.props
+35 −11 MultiTarget/PackageReferences/Uno.props
+1 −1 MultiTarget/Test-Component-Support.ps1
+0 −3 MultiTarget/UseUnoWinUI.ps1
+42 −0 ProjectHeads/AllComponents/Uno/Assets/Icons/icon.svg
+137 −0 ProjectHeads/AllComponents/Uno/Assets/Icons/icon_foreground.svg
+32 −0 ProjectHeads/AllComponents/Uno/Assets/SharedAssets.md
+137 −0 ProjectHeads/AllComponents/Uno/Assets/Splash/splash_screen.svg
+96 −0 ProjectHeads/AllComponents/Uno/CommunityToolkit.App.Uno.csproj
+5 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/AndroidManifest.xml
+5 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/Assets/AboutAssets.txt
+23 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/Main.Android.cs
+20 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/MainActivity.Android.cs
+4 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Strings.xml
+8 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Styles.xml
+2 −0 ProjectHeads/AllComponents/Uno/Platforms/Android/environment.conf
+23 −0 ProjectHeads/AllComponents/Uno/Platforms/Desktop/Program.cs
+3 −0 ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/LinkerConfig.xml
+19 −0 ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/Program.cs
+3 −0 ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js
+10 −0 ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/manifest.webmanifest
+6 −0 ProjectHeads/AllComponents/Uno/Platforms/iOS/Entitlements.plist
+43 −0 ProjectHeads/AllComponents/Uno/Platforms/iOS/Info.plist
+21 −0 ProjectHeads/AllComponents/Uno/Platforms/iOS/Main.iOS.cs
+20 −0 ProjectHeads/AllComponents/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json
+31 −0 ProjectHeads/AllComponents/Uno/Platforms/iOS/PrivacyInfo.xcprivacy
+13 −1 ProjectHeads/AllComponents/Wasm/Program.cs
+0 −2 ProjectHeads/App.Head.Uno.UI.Dependencies.props
+1 −1 ProjectHeads/App.Head.Uno.WinUI.Dependencies.props
+5 −3 ProjectHeads/App.Head.Uno.props
+2 −1 ProjectHeads/App.Head.Wasm.props
+4 −4 ProjectHeads/App.Head.props
+4 −2 ProjectHeads/GenerateSingleSampleHeads.ps1
+42 −0 ProjectHeads/SingleComponent/Uno/Assets/Icons/icon.svg
+137 −0 ProjectHeads/SingleComponent/Uno/Assets/Icons/icon_foreground.svg
+32 −0 ProjectHeads/SingleComponent/Uno/Assets/SharedAssets.md
+137 −0 ProjectHeads/SingleComponent/Uno/Assets/Splash/splash_screen.svg
+5 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/AndroidManifest.xml
+5 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/Assets/AboutAssets.txt
+23 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/Main.Android.cs
+20 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/MainActivity.Android.cs
+4 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Strings.xml
+8 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Styles.xml
+2 −0 ProjectHeads/SingleComponent/Uno/Platforms/Android/environment.conf
+23 −0 ProjectHeads/SingleComponent/Uno/Platforms/Desktop/Program.cs
+3 −0 ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/LinkerConfig.xml
+19 −0 ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/Program.cs
+3 −0 ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js
+10 −0 ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/manifest.webmanifest
+6 −0 ProjectHeads/SingleComponent/Uno/Platforms/iOS/Entitlements.plist
+43 −0 ProjectHeads/SingleComponent/Uno/Platforms/iOS/Info.plist
+21 −0 ProjectHeads/SingleComponent/Uno/Platforms/iOS/Main.iOS.cs
+20 −0 ProjectHeads/SingleComponent/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json
+31 −0 ProjectHeads/SingleComponent/Uno/Platforms/iOS/PrivacyInfo.xcprivacy
+91 −0 ProjectHeads/SingleComponent/Uno/ProjectTemplate.Uno.csproj
+16 −0 ProjectHeads/SingleComponent/Wasm/Program.cs
+1 −1 ProjectHeads/Tests.Head.props
+3 −2 global.json
Loading