diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0427f67c..df7847fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,6 +111,9 @@ 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 @@ -118,14 +121,16 @@ jobs: - 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' || '' }} # Build and use template for creating new experiments - name: Build ProjectTemplate @@ -145,6 +150,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 @@ -177,6 +185,10 @@ jobs: with: global-json-file: tooling/global.json + - name: Install .NET workloads + if: ${{ matrix.multitarget == 'wasm' }} + run: dotnet workload install wasm-tools + - name: .NET Info (if diagnostics) if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }} run: dotnet --info @@ -186,6 +198,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 @@ -209,12 +222,29 @@ 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.multitarget == 'wasm' && ' -IncludeUnoSdkHead' || '' }} + ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} - name: MSBuild + if: ${{ matrix.multitarget != 'wasm' }} working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }} run: msbuild.exe ${{ env.TEST_PROJECT_NAME }}.sln /restore /nowarn:MSB4011 -p:Configuration=Release + - name: Build Uno head (browserwasm) + if: ${{ matrix.multitarget == 'wasm' }} + working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }} + run: dotnet build heads/Uno/${{ env.TEST_PROJECT_NAME }}.Uno.csproj -f net9.0-browserwasm -p:Configuration=Release + + - name: Build Uno head (desktop) + if: ${{ matrix.multitarget == 'wasm' }} + working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }} + run: dotnet build heads/Uno/${{ env.TEST_PROJECT_NAME }}.Uno.csproj -f net9.0-desktop -p:Configuration=Release + # Run tests - name: Setup VSTest Path uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44 @@ -241,10 +271,11 @@ jobs: name: new-experiment-logs path: ./**/*.*log - wasm-linux: - runs-on: ubuntu-latest + uno-linux: + runs-on: windows-2022 env: HEADS_DIRECTORY: tooling/ProjectHeads + PROJECT_DIRECTORY: tooling/ProjectTemplate TEST_PROJECT_NAME: CiTestExp steps: @@ -259,6 +290,9 @@ jobs: with: global-json-file: tooling/global.json + - name: Install .NET workloads + run: dotnet workload install android ios maui wasm-tools + - name: .NET Info (if diagnostics) if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }} run: dotnet --info @@ -268,10 +302,14 @@ 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 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + # Restore Tools from Manifest list in the Repository - name: Restore dotnet tools working-directory: ./ @@ -289,14 +327,30 @@ 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 - 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? + + - 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 + + - 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 @@ -304,5 +358,3 @@ jobs: with: name: linux-logs path: ./**/*.*log - - diff --git a/Build-Toolkit-Components.ps1 b/Build-Toolkit-Components.ps1 index 6cbc0ec5..94e30757 100644 --- a/Build-Toolkit-Components.ps1 +++ b/Build-Toolkit-Components.ps1 @@ -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")] @@ -97,7 +97,7 @@ 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) @@ -105,11 +105,11 @@ 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) diff --git a/Build-Toolkit-Gallery.ps1 b/Build-Toolkit-Gallery.ps1 index 7d92154e..06d85adc 100644 --- a/Build-Toolkit-Gallery.ps1 +++ b/Build-Toolkit-Gallery.ps1 @@ -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'. @@ -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')] @@ -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) { diff --git a/CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs b/CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs index 2b0d3293..880e0182 100644 --- a/CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs +++ b/CommunityToolkit.App.Shared/Renderers/Markdown/MarkdownTextBlock.cs @@ -16,80 +16,11 @@ #endif #endif -#if HAS_UNO_WASM -using Markdig; -using Uno.Foundation.Interop; -using Uno.UI.Runtime.WebAssembly; -#endif - namespace CommunityToolkit.App.Shared.Renderers; /// /// 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. /// -#if HAS_UNO_WASM -[HtmlElement("div")] -public partial class MarkdownTextBlock : TextBlock -{ - public MarkdownTextBlock() - { - Loaded += this.MarkdownTextBlock_Loaded; - } - - protected override void OnTextChanged(string oldValue, string newValue) - { - if (IsLoaded) - { - UpdateText(newValue); - } - } - - private void MarkdownTextBlock_Loaded(object sender, RoutedEventArgs e) - { - this.RegisterHtmlEventHandler("resize", HtmlElementResized); - - UpdateText(Text); - } - - #nullable enable - private void HtmlElementResized(object? sender, EventArgs e) - { - this.InvalidateMeasure(); - } - - private void UpdateText(string markdown) - { - // TODO: Check color hasn't changed since last time. - var color = (Foreground as SolidColorBrush)?.Color; - if (color != null) - { - this.SetCssStyle(("color", $"#{color!.ToString()!.Substring(3)}"), ("font-family", "Segoe UI")); - } - else - { - this.SetCssStyle("fontFamily", "Segoe UI"); - } - - this.SetCssClass("fluent-hyperlink-style"); - - this.SetHtmlContent(Markdown.ToHtml(markdown)); - - this.InvalidateMeasure(); - } - - protected override Size MeasureOverride(Size availableSize) - { - var size = this.MeasureHtmlView(availableSize, true); - - return size; - } - - //// Polyfill dummy for event callback - #pragma warning disable CS0067 // Unused on purpose for polyfill - public event EventHandler? LinkClicked; - #pragma warning restore CS0067 // Unused on purpose for polyfill -} -#else public partial class MarkdownTextBlock : ToolkitMTB { #if !HAS_UNO @@ -105,7 +36,6 @@ public MarkdownTextBlock() #pragma warning restore CS0067 // Unused on purpose for polyfill #endif } -#endif #if HAS_UNO //// Polyfill dummy for event callback diff --git a/GenerateAllSolution.ps1 b/GenerateAllSolution.ps1 index 72eb9bac..2a2bb12c 100644 --- a/GenerateAllSolution.ps1 +++ b/GenerateAllSolution.ps1 @@ -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")] @@ -54,12 +54,14 @@ Param ( [string[]]$ExcludeComponents, [switch]$UseDiagnostics = $false, - - [bool]$Launch = $true + + [bool]$Launch = $true, + + [switch]$IncludeUnoSdkHead = $false ) 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) @@ -67,18 +69,15 @@ 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 } @@ -150,11 +149,11 @@ 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. -# === foreach ($multitarget in $allUsedMultiTargetPrefs) { + if ($multitarget -eq 'wasm') { + continue + } + # capitalize first letter, avoid case sensitivity issues on linux $csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower() @@ -168,6 +167,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" diff --git a/GenerateSingleSolution.ps1 b/GenerateSingleSolution.ps1 index 9f6c5736..3920a535 100644 --- a/GenerateSingleSolution.ps1 +++ b/GenerateSingleSolution.ps1 @@ -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'), @@ -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 ) if ($null -ne $Env:Path -and $Env:Path.ToLower().Contains("msbuild") -eq $false) { @@ -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', 'macos', 'ios', 'android') } if ($null -eq $ExcludeMultiTargets) @@ -106,18 +108,15 @@ 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 } @@ -182,9 +181,11 @@ 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. foreach ($multitarget in $MultiTargets) { + if ($multitarget -eq 'wasm') { + continue + } + # capitalize first letter, avoid case sensitivity issues on linux $csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower() @@ -202,6 +203,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" diff --git a/GenerateVSCodeLaunchConfig.ps1 b/GenerateVSCodeLaunchConfig.ps1 index 58ced9ed..900be217 100644 --- a/GenerateVSCodeLaunchConfig.ps1 +++ b/GenerateVSCodeLaunchConfig.ps1 @@ -20,12 +20,12 @@ function CreateVsCodeLaunchConfigJson { `"/p:UnoSourceGeneratorUseGenerationHost=true`", `"/p:UnoSourceGeneratorUseGenerationController=false`", `"/p:UnoRemoteControlPort=443`", - `"--project=`$`{workspaceFolder`}/components/$projectName/heads/Wasm/$projectName.Wasm.csproj`" + `"--project=`$`{workspaceFolder`}/components/$projectName/heads/Uno/$projectName.Uno.csproj`" ], `"presentation`": { `"group`": `"2`" }, - `"cwd`": `"`$`{workspaceFolder`}/components/$projectName/heads/Wasm`" + `"cwd`": `"`$`{workspaceFolder`}/components/$projectName/heads/Uno`" }"; } diff --git a/MultiTarget/AvailableTargetFrameworks.props b/MultiTarget/AvailableTargetFrameworks.props index 02f9d9aa..7ea4cd34 100644 --- a/MultiTarget/AvailableTargetFrameworks.props +++ b/MultiTarget/AvailableTargetFrameworks.props @@ -13,17 +13,13 @@ net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0; net9.0; - net9.0; - net9.0; net9.0-android; net9.0-maccatalyst; net9.0-ios; - net9.0; net9.0; - net9.0; netstandard2.0; diff --git a/MultiTarget/Defaults.props b/MultiTarget/Defaults.props index 86e5e82f..20665cb2 100644 --- a/MultiTarget/Defaults.props +++ b/MultiTarget/Defaults.props @@ -1,5 +1,5 @@ - uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; + uwp;wasdk;wasm;macos;ios;android; \ No newline at end of file diff --git a/MultiTarget/DefinedConstants.props b/MultiTarget/DefinedConstants.props index b5c8c2c9..37f46b79 100644 --- a/MultiTarget/DefinedConstants.props +++ b/MultiTarget/DefinedConstants.props @@ -12,9 +12,6 @@ $(DefineConstants);__ANDROID__; $(DefineConstants);__IOS__; $(DefineConstants);__MACOS__; - $(DefineConstants);HAS_UNO_SKIA;__SKIA__;WINDOWS_WPF; - $(DefineConstants);HAS_UNO_SKIA;__SKIA__;__GTK__; - $(DefineConstants);NET9_0_OR_GREATER $(DefineConstants);NET8_0_OR_GREATER $(DefineConstants);NET7_0_OR_GREATER diff --git a/MultiTarget/EnabledTargetFrameworks.props b/MultiTarget/EnabledTargetFrameworks.props index 6f1c0ab9..ca4bb1ec 100644 --- a/MultiTarget/EnabledTargetFrameworks.props +++ b/MultiTarget/EnabledTargetFrameworks.props @@ -10,11 +10,11 @@ $(TargetFrameworks);$(WinAppSdkTargetFrameworks) - true - true + true + true $(TargetFrameworks);$(DotnetCommonTargetFramework) $(TargetFrameworks);$(MacOSLibTargetFrameworks) diff --git a/MultiTarget/Filter-Supported-Components.ps1 b/MultiTarget/Filter-Supported-Components.ps1 index bc187e85..db01e964 100644 --- a/MultiTarget/Filter-Supported-Components.ps1 +++ b/MultiTarget/Filter-Supported-Components.ps1 @@ -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, @@ -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 = @(); diff --git a/MultiTarget/GenerateAllProjectReferences.ps1 b/MultiTarget/GenerateAllProjectReferences.ps1 index 62ca3b02..43d4f262 100644 --- a/MultiTarget/GenerateAllProjectReferences.ps1 +++ b/MultiTarget/GenerateAllProjectReferences.ps1 @@ -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"), diff --git a/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 b/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 index dbbd6728..a7b2849f 100644 --- a/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 +++ b/MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1 @@ -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")) { @@ -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 ', ')" @@ -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")'"; diff --git a/MultiTarget/MultiTargetAwareProjectReference.props.template b/MultiTarget/MultiTargetAwareProjectReference.props.template index 86b3c4d8..5d3bb133 100644 --- a/MultiTarget/MultiTargetAwareProjectReference.props.template +++ b/MultiTarget/MultiTargetAwareProjectReference.props.template @@ -10,8 +10,6 @@ true - true - true true true true @@ -29,14 +27,6 @@ true true - true - true - true - - true - true - true - true true @@ -47,7 +37,7 @@ true true - true + true - + true - - + + - - - - - - - - - - - $(NoWarn);NU1701; - - + true + true + true + true + 3 + true + WinUI + + $(DefineConstants);WINUI3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceAssets/%(RecursiveDir)%(FileName)%(Extension) + + + SourceAssets/%(RecursiveDir)%(FileName)%(Extension) + + + SourceAssets/%(RecursiveDir)%(FileName)%(Extension).dat + + + + + + $(NoWarn);IL2026;Uno0006 + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/AndroidManifest.xml b/ProjectHeads/AllComponents/Uno/Platforms/Android/AndroidManifest.xml new file mode 100644 index 00000000..24ee4aea --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/Assets/AboutAssets.txt b/ProjectHeads/AllComponents/Uno/Platforms/Android/Assets/AboutAssets.txt new file mode 100644 index 00000000..6b8fc66e --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/Assets/AboutAssets.txt @@ -0,0 +1,5 @@ +Any raw assets you want to be deployed with your application can be placed in this +directory (and child directories). Deployment of the asset to your application is done +using the IDE or by using the following MSBuild property in your .csproj: + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/Main.Android.cs b/ProjectHeads/AllComponents/Uno/Platforms/Android/Main.Android.cs new file mode 100644 index 00000000..18ea8687 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/Main.Android.cs @@ -0,0 +1,19 @@ +using Android.App; +using Android.Runtime; + +namespace CommunityToolkit.App.Uno; + +[global::Android.App.ApplicationAttribute( + Label = "@string/ApplicationName", + Icon = "@mipmap/iconapp", + LargeHeap = true, + HardwareAccelerated = true, + Theme = "@style/AppTheme" +)] +public class Application : Microsoft.UI.Xaml.NativeApplication +{ + public Application(IntPtr javaReference, JniHandleOwnership transfer) + : base(() => new CommunityToolkit.App.Shared.App(), javaReference, transfer) + { + } +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/MainActivity.Android.cs b/ProjectHeads/AllComponents/Uno/Platforms/Android/MainActivity.Android.cs new file mode 100644 index 00000000..c0164819 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/MainActivity.Android.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace CommunityToolkit.App.Uno; + +[Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden +)] +public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity +{ +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Strings.xml b/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Strings.xml new file mode 100644 index 00000000..ee06a129 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Strings.xml @@ -0,0 +1,4 @@ + + + CommunityToolkit + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Styles.xml b/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Styles.xml new file mode 100644 index 00000000..2c3bf24a --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/Resources/values/Styles.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Android/environment.conf b/ProjectHeads/AllComponents/Uno/Platforms/Android/environment.conf new file mode 100644 index 00000000..9d9709a9 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Android/environment.conf @@ -0,0 +1,2 @@ +## Mono GC tuning params +MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep diff --git a/ProjectHeads/AllComponents/Uno/Platforms/Desktop/Program.cs b/ProjectHeads/AllComponents/Uno/Platforms/Desktop/Program.cs new file mode 100644 index 00000000..031d0325 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/Desktop/Program.cs @@ -0,0 +1,19 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +internal class Program +{ + [STAThread] + public static void Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseX11() + .UseLinuxFrameBuffer() + .UseMacOS() + .UseWin32() + .Build(); + + host.Run(); + } +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/LinkerConfig.xml b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/LinkerConfig.xml new file mode 100644 index 00000000..cc3e5cdd --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/LinkerConfig.xml @@ -0,0 +1,3 @@ + + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/Program.cs b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/Program.cs new file mode 100644 index 00000000..d1707888 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/Program.cs @@ -0,0 +1,15 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +public class Program +{ + public static async Task Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseWebAssembly() + .Build(); + + await host.RunAsync(); + } +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js new file mode 100644 index 00000000..8018667f --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js @@ -0,0 +1,3 @@ +var UnoAppManifest = { + displayName: "CommunityToolkit" +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/iOS/Entitlements.plist b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Entitlements.plist new file mode 100644 index 00000000..6631ffa6 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/iOS/Info.plist b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Info.plist new file mode 100644 index 00000000..8f81dd88 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + + CFBundleIdentifier + com.companyname.CommunityToolkit + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CommunityToolkit + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + MinimumOSVersion + 16.0 + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ProjectHeads/AllComponents/Uno/Platforms/iOS/Main.iOS.cs b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Main.iOS.cs new file mode 100644 index 00000000..2acc5ec3 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Main.iOS.cs @@ -0,0 +1,17 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +namespace CommunityToolkit.App.Uno; + +public class EntryPoint +{ + public static void Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseAppleUIKit() + .Build(); + + host.Run(); + } +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json new file mode 100644 index 00000000..4103a707 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json @@ -0,0 +1,20 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} diff --git a/ProjectHeads/AllComponents/Uno/Platforms/iOS/PrivacyInfo.xcprivacy b/ProjectHeads/AllComponents/Uno/Platforms/iOS/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..1d00d2f5 --- /dev/null +++ b/ProjectHeads/AllComponents/Uno/Platforms/iOS/PrivacyInfo.xcprivacy @@ -0,0 +1,31 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + + diff --git a/ProjectHeads/AllComponents/Wasm/CommunityToolkit.App.Wasm.csproj b/ProjectHeads/AllComponents/Wasm/CommunityToolkit.App.Wasm.csproj deleted file mode 100644 index ad0e0d70..00000000 --- a/ProjectHeads/AllComponents/Wasm/CommunityToolkit.App.Wasm.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - true - true - true - true - true - - true - wasm - - - - - - - - - - - - - - - - diff --git a/ProjectHeads/AllComponents/Wasm/Program.cs b/ProjectHeads/AllComponents/Wasm/Program.cs deleted file mode 100644 index 43e990c1..00000000 --- a/ProjectHeads/AllComponents/Wasm/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using CommunityToolkit.App.Shared; - -#if WINAPPSDK -using Microsoft.UI.Xaml; -#else -using Windows.UI.Xaml; -#endif - -namespace CommunityToolkit.App.Wasm; - -public class Program -{ - private static CommunityToolkit.App.Shared.App? _app; - - static int Main(string[] args) - { - Application.Start(_ => _app = new CommunityToolkit.App.Shared.App()); - - return 0; - } -} diff --git a/ProjectHeads/AllComponents/Wasm/Properties/launchSettings.json b/ProjectHeads/AllComponents/Wasm/Properties/launchSettings.json deleted file mode 100644 index e18516df..00000000 --- a/ProjectHeads/AllComponents/Wasm/Properties/launchSettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:52475/", - "sslPort": 44386 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "CommunityToolkit.App.Wasm": { - "commandName": "Project", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/ProjectHeads/AllComponents/Wasm/WasmScripts/AppManifest.js b/ProjectHeads/AllComponents/Wasm/WasmScripts/AppManifest.js deleted file mode 100644 index f03a5d4c..00000000 --- a/ProjectHeads/AllComponents/Wasm/WasmScripts/AppManifest.js +++ /dev/null @@ -1,5 +0,0 @@ -var UnoAppManifest = { - splashScreenImage: "Assets/SplashScreen.png", - splashScreenColor: "#fff", - displayName: "Windows Community Toolkit Gallery" -} diff --git a/ProjectHeads/AllComponents/Wasm/wwwroot/SharedArrayBufferServiceWorker.js b/ProjectHeads/AllComponents/Wasm/wwwroot/SharedArrayBufferServiceWorker.js deleted file mode 100644 index d8f6b3c2..00000000 --- a/ProjectHeads/AllComponents/Wasm/wwwroot/SharedArrayBufferServiceWorker.js +++ /dev/null @@ -1,39 +0,0 @@ -// From https://dev.to/stefnotch/enabling-coop-coep-without-touching-the-server-2d3n - -self.addEventListener("install", function () { - self.skipWaiting(); -}); - -self.addEventListener("activate", (event) => { - event.waitUntil(self.clients.claim()); -}); - -self.addEventListener("fetch", function (event) { - if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") { - return; - } - - event.respondWith( - fetch(event.request) - .then(function (response) { - // It seems like we only need to set the headers for index.html - // If you want to be on the safe side, comment this out - // if (!response.url.includes("index.html")) return response; - - const newHeaders = new Headers(response.headers); - newHeaders.set("Cross-Origin-Embedder-Policy", "credentialless"); - newHeaders.set("Cross-Origin-Opener-Policy", "same-origin"); - - const moddedResponse = new Response(response.body, { - status: response.status, - statusText: response.statusText, - headers: newHeaders, - }); - - return moddedResponse; - }) - .catch(function (e) { - console.error(e); - }) - ); -}); diff --git a/ProjectHeads/AllComponents/Wasm/wwwroot/index.html b/ProjectHeads/AllComponents/Wasm/wwwroot/index.html deleted file mode 100644 index 095835f0..00000000 --- a/ProjectHeads/AllComponents/Wasm/wwwroot/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - $(ADDITIONAL_CSS) - $(ADDITIONAL_HEAD) - - -
-
- - - - - - -
-
- - - \ No newline at end of file diff --git a/ProjectHeads/AllComponents/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js b/ProjectHeads/AllComponents/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js deleted file mode 100644 index 239087eb..00000000 --- a/ProjectHeads/AllComponents/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js +++ /dev/null @@ -1,19 +0,0 @@ -// From https://dev.to/stefnotch/enabling-coop-coep-without-touching-the-server-2d3n - -if ("serviceWorker" in navigator) { - // Register service worker - navigator.serviceWorker.register(new URL("SharedArrayBufferServiceWorker.js", window.location.href)).then( - function (registration) { - console.log("COOP/COEP Service Worker registered", registration.scope); - // If the registration is active, but it's not controlling the page - if (registration.active && !navigator.serviceWorker.controller) { - window.location.reload(); - } - }, - function (err) { - console.log("COOP/COEP Service Worker failed to register", err); - } - ); -} else { - console.warn("Cannot register a service worker"); -} diff --git a/ProjectHeads/AllComponents/Wasm/wwwroot/web.config b/ProjectHeads/AllComponents/Wasm/wwwroot/web.config deleted file mode 100644 index d741ecfc..00000000 --- a/ProjectHeads/AllComponents/Wasm/wwwroot/web.config +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ProjectHeads/App.Head.Uno.UI.Dependencies.props b/ProjectHeads/App.Head.Uno.UI.Dependencies.props deleted file mode 100644 index 361463b9..00000000 --- a/ProjectHeads/App.Head.Uno.UI.Dependencies.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props b/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props deleted file mode 100644 index d18fbfb5..00000000 --- a/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ProjectHeads/App.Head.Uno.props b/ProjectHeads/App.Head.Uno.props deleted file mode 100644 index 865ea717..00000000 --- a/ProjectHeads/App.Head.Uno.props +++ /dev/null @@ -1,32 +0,0 @@ - - - WinUI - - - - - - - - - - $(NoWarn);IL2026 - - - $(NoWarn);Uno0006 - - - - - diff --git a/ProjectHeads/App.Head.Wasm.props b/ProjectHeads/App.Head.Wasm.props deleted file mode 100644 index 9861b527..00000000 --- a/ProjectHeads/App.Head.Wasm.props +++ /dev/null @@ -1,79 +0,0 @@ - - - Exe - $(WasmHeadTargetFramework.Split(';')[0]) - - - - - - - true - - - - false - - - Interpreter - Interpreter - InterpreterAndAOT - - - false - 8 - - - $(MSBuildProjectDirectory)\wwwroot\index.html - - - InPlace - - - true - - - true - - - - - - - - - - - - - - - - - true - $(DefineConstants);TRACE;DEBUG - portable - true - - - false - Interpreter - - - - - - - - - - - - - - - - diff --git a/ProjectHeads/GenerateSingleSampleHeads.ps1 b/ProjectHeads/GenerateSingleSampleHeads.ps1 index 0bbee407..a684380d 100644 --- a/ProjectHeads/GenerateSingleSampleHeads.ps1 +++ b/ProjectHeads/GenerateSingleSampleHeads.ps1 @@ -30,7 +30,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'), @@ -43,9 +43,11 @@ Param ( [string]$componentPath, [Parameter(HelpMessage = "Add extra diagnostic output to slngen generator.")] - [switch]$UseDiagnostics = $false + [switch]$UseDiagnostics = $false, + + [switch]$IncludeUnoSdkHead = $false ) # Use & and a separate script path variable to avoid issues with parameter passing $scriptPath = "$PSScriptRoot/../GenerateSingleSolution.ps1" -& $scriptPath -MultiTargets $MultiTargets -ExcludeMultiTargets $ExcludeMultiTargets -WinUIMajorVersion $WinUIMajorVersion -UseDiagnostics:$UseDiagnostics -componentPath $componentPath \ No newline at end of file +& $scriptPath -MultiTargets $MultiTargets -ExcludeMultiTargets $ExcludeMultiTargets -WinUIMajorVersion $WinUIMajorVersion -UseDiagnostics:$UseDiagnostics -IncludeUnoSdkHead:$IncludeUnoSdkHead -componentPath $componentPath \ No newline at end of file diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/AndroidManifest.xml b/ProjectHeads/SingleComponent/Uno/Platforms/Android/AndroidManifest.xml new file mode 100644 index 00000000..24ee4aea --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/Assets/AboutAssets.txt b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Assets/AboutAssets.txt new file mode 100644 index 00000000..6b8fc66e --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Assets/AboutAssets.txt @@ -0,0 +1,5 @@ +Any raw assets you want to be deployed with your application can be placed in this +directory (and child directories). Deployment of the asset to your application is done +using the IDE or by using the following MSBuild property in your .csproj: + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/Main.Android.cs b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Main.Android.cs new file mode 100644 index 00000000..18ea8687 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Main.Android.cs @@ -0,0 +1,19 @@ +using Android.App; +using Android.Runtime; + +namespace CommunityToolkit.App.Uno; + +[global::Android.App.ApplicationAttribute( + Label = "@string/ApplicationName", + Icon = "@mipmap/iconapp", + LargeHeap = true, + HardwareAccelerated = true, + Theme = "@style/AppTheme" +)] +public class Application : Microsoft.UI.Xaml.NativeApplication +{ + public Application(IntPtr javaReference, JniHandleOwnership transfer) + : base(() => new CommunityToolkit.App.Shared.App(), javaReference, transfer) + { + } +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/MainActivity.Android.cs b/ProjectHeads/SingleComponent/Uno/Platforms/Android/MainActivity.Android.cs new file mode 100644 index 00000000..c0164819 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/MainActivity.Android.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace CommunityToolkit.App.Uno; + +[Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden +)] +public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity +{ +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Strings.xml b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Strings.xml new file mode 100644 index 00000000..ee06a129 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Strings.xml @@ -0,0 +1,4 @@ + + + CommunityToolkit + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Styles.xml b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Styles.xml new file mode 100644 index 00000000..2c3bf24a --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/Resources/values/Styles.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Android/environment.conf b/ProjectHeads/SingleComponent/Uno/Platforms/Android/environment.conf new file mode 100644 index 00000000..9d9709a9 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Android/environment.conf @@ -0,0 +1,2 @@ +## Mono GC tuning params +MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/Desktop/Program.cs b/ProjectHeads/SingleComponent/Uno/Platforms/Desktop/Program.cs new file mode 100644 index 00000000..031d0325 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/Desktop/Program.cs @@ -0,0 +1,19 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +internal class Program +{ + [STAThread] + public static void Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseX11() + .UseLinuxFrameBuffer() + .UseMacOS() + .UseWin32() + .Build(); + + host.Run(); + } +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/LinkerConfig.xml b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/LinkerConfig.xml new file mode 100644 index 00000000..cc3e5cdd --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/LinkerConfig.xml @@ -0,0 +1,3 @@ + + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/Program.cs b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/Program.cs new file mode 100644 index 00000000..d1707888 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/Program.cs @@ -0,0 +1,15 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +public class Program +{ + public static async Task Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseWebAssembly() + .Build(); + + await host.RunAsync(); + } +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js new file mode 100644 index 00000000..8018667f --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/WebAssembly/WasmScripts/AppManifest.js @@ -0,0 +1,3 @@ +var UnoAppManifest = { + displayName: "CommunityToolkit" +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Entitlements.plist b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Entitlements.plist new file mode 100644 index 00000000..6631ffa6 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Info.plist b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Info.plist new file mode 100644 index 00000000..8f81dd88 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + + CFBundleIdentifier + com.companyname.CommunityToolkit + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CommunityToolkit + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + MinimumOSVersion + 16.0 + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Main.iOS.cs b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Main.iOS.cs new file mode 100644 index 00000000..2acc5ec3 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Main.iOS.cs @@ -0,0 +1,17 @@ +using Uno.UI.Hosting; +using CommunityToolkit.App.Shared; + +namespace CommunityToolkit.App.Uno; + +public class EntryPoint +{ + public static void Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseAppleUIKit() + .Build(); + + host.Run(); + } +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json new file mode 100644 index 00000000..4103a707 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json @@ -0,0 +1,20 @@ +{ + "images": [ + { + "idiom": "universal", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} diff --git a/ProjectHeads/SingleComponent/Uno/Platforms/iOS/PrivacyInfo.xcprivacy b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..1d00d2f5 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/Platforms/iOS/PrivacyInfo.xcprivacy @@ -0,0 +1,31 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + + diff --git a/ProjectHeads/SingleComponent/Uno/ProjectTemplate.Uno.csproj b/ProjectHeads/SingleComponent/Uno/ProjectTemplate.Uno.csproj new file mode 100644 index 00000000..aba78b06 --- /dev/null +++ b/ProjectHeads/SingleComponent/Uno/ProjectTemplate.Uno.csproj @@ -0,0 +1,85 @@ + + + Exe + net9.0-desktop;net9.0-browserwasm;net9.0-android;net9.0-ios + + + SkiaRenderer; + + + false + + + true + true + true + true + 3 + true + WinUI + + $(DefineConstants);WINUI3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceAssets/%(RecursiveDir)%(FileName)%(Extension).dat + + + + + + + $(NoWarn);IL2026;Uno0006 + + diff --git a/ProjectHeads/SingleComponent/Wasm/Program.cs b/ProjectHeads/SingleComponent/Wasm/Program.cs deleted file mode 100644 index 9522ede6..00000000 --- a/ProjectHeads/SingleComponent/Wasm/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using CommunityToolkit.App.Shared; - -namespace ProjectTemplateExperiment.Samples.Wasm; - -public class Program -{ - private static App? _app; - - static int Main(string[] args) - { - Application.Start(_ => _app = new App()); - - return 0; - } -} diff --git a/ProjectHeads/SingleComponent/Wasm/ProjectTemplate.Wasm.csproj b/ProjectHeads/SingleComponent/Wasm/ProjectTemplate.Wasm.csproj deleted file mode 100644 index 701313e8..00000000 --- a/ProjectHeads/SingleComponent/Wasm/ProjectTemplate.Wasm.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - true - true - true - true - true - - true - - - - - - - - - - - - - - - - - - - - diff --git a/ProjectHeads/SingleComponent/Wasm/Properties/launchSettings.json b/ProjectHeads/SingleComponent/Wasm/Properties/launchSettings.json deleted file mode 100644 index 39ec28bd..00000000 --- a/ProjectHeads/SingleComponent/Wasm/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:52475/", - "sslPort": 44386 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "ProjectTemplate.Wasm": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} diff --git a/ProjectHeads/SingleComponent/Wasm/WasmScripts/AppManifest.js b/ProjectHeads/SingleComponent/Wasm/WasmScripts/AppManifest.js deleted file mode 100644 index e2c412a4..00000000 --- a/ProjectHeads/SingleComponent/Wasm/WasmScripts/AppManifest.js +++ /dev/null @@ -1,5 +0,0 @@ -var UnoAppManifest = { - splashScreenImage: "Assets/SplashScreen.png", - splashScreenColor: "#fff", - displayName: "Labs: ProjectTemplate" -} diff --git a/ProjectHeads/SingleComponent/Wasm/wwwroot/SharedArrayBufferServiceWorker.js b/ProjectHeads/SingleComponent/Wasm/wwwroot/SharedArrayBufferServiceWorker.js deleted file mode 100644 index d8f6b3c2..00000000 --- a/ProjectHeads/SingleComponent/Wasm/wwwroot/SharedArrayBufferServiceWorker.js +++ /dev/null @@ -1,39 +0,0 @@ -// From https://dev.to/stefnotch/enabling-coop-coep-without-touching-the-server-2d3n - -self.addEventListener("install", function () { - self.skipWaiting(); -}); - -self.addEventListener("activate", (event) => { - event.waitUntil(self.clients.claim()); -}); - -self.addEventListener("fetch", function (event) { - if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") { - return; - } - - event.respondWith( - fetch(event.request) - .then(function (response) { - // It seems like we only need to set the headers for index.html - // If you want to be on the safe side, comment this out - // if (!response.url.includes("index.html")) return response; - - const newHeaders = new Headers(response.headers); - newHeaders.set("Cross-Origin-Embedder-Policy", "credentialless"); - newHeaders.set("Cross-Origin-Opener-Policy", "same-origin"); - - const moddedResponse = new Response(response.body, { - status: response.status, - statusText: response.statusText, - headers: newHeaders, - }); - - return moddedResponse; - }) - .catch(function (e) { - console.error(e); - }) - ); -}); diff --git a/ProjectHeads/SingleComponent/Wasm/wwwroot/index.html b/ProjectHeads/SingleComponent/Wasm/wwwroot/index.html deleted file mode 100644 index 095835f0..00000000 --- a/ProjectHeads/SingleComponent/Wasm/wwwroot/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - $(ADDITIONAL_CSS) - $(ADDITIONAL_HEAD) - - -
-
- - - - - - -
-
- - - \ No newline at end of file diff --git a/ProjectHeads/SingleComponent/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js b/ProjectHeads/SingleComponent/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js deleted file mode 100644 index 239087eb..00000000 --- a/ProjectHeads/SingleComponent/Wasm/wwwroot/scripts/EnableSharedArrayBuffer.js +++ /dev/null @@ -1,19 +0,0 @@ -// From https://dev.to/stefnotch/enabling-coop-coep-without-touching-the-server-2d3n - -if ("serviceWorker" in navigator) { - // Register service worker - navigator.serviceWorker.register(new URL("SharedArrayBufferServiceWorker.js", window.location.href)).then( - function (registration) { - console.log("COOP/COEP Service Worker registered", registration.scope); - // If the registration is active, but it's not controlling the page - if (registration.active && !navigator.serviceWorker.controller) { - window.location.reload(); - } - }, - function (err) { - console.log("COOP/COEP Service Worker failed to register", err); - } - ); -} else { - console.warn("Cannot register a service worker"); -} diff --git a/ProjectHeads/SingleComponent/Wasm/wwwroot/web.config b/ProjectHeads/SingleComponent/Wasm/wwwroot/web.config deleted file mode 100644 index d741ecfc..00000000 --- a/ProjectHeads/SingleComponent/Wasm/wwwroot/web.config +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ProjectTemplate/src/MultiTarget.props b/ProjectTemplate/src/MultiTarget.props index b11c1942..caab2d42 100644 --- a/ProjectTemplate/src/MultiTarget.props +++ b/ProjectTemplate/src/MultiTarget.props @@ -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. --> - uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; + uwp;wasdk;wasm;macos;ios;android; \ No newline at end of file diff --git a/global.json b/global.json index cfa58f62..200291be 100644 --- a/global.json +++ b/global.json @@ -3,8 +3,9 @@ "version": "9.0.310", "rollForward": "latestFeature" }, - "msbuild-sdks": + "msbuild-sdks": { - "MSBuild.Sdk.Extras":"3.0.23" + "MSBuild.Sdk.Extras":"3.0.23", + "Uno.Sdk": "6.4.58" } }