Skip to content

Update default WinUIMajorVersion to 3 in build scripts #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2025
Merged
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
2 changes: 1 addition & 1 deletion Build-Toolkit-Components.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Param (
[hashtable]$AdditionalProperties,

[Alias("winui")]
[int]$WinUIMajorVersion = 2,
[int]$WinUIMajorVersion = 3,

[string]$ComponentDir = "src",

Expand Down
2 changes: 1 addition & 1 deletion Build-Toolkit-Gallery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Param (
[hashtable]$AdditionalProperties,

[Alias("winui")]
[int]$WinUIMajorVersion = 2,
[int]$WinUIMajorVersion = 3,

[Alias("c")]
[string[]]$Components = @("all"),
Expand Down
2 changes: 1 addition & 1 deletion GenerateAllSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Param (
[string[]]$Components = @('all'),

[Alias("winui")]
[int]$WinUIMajorVersion = 2,
[int]$WinUIMajorVersion = 3,

[string[]]$ExcludeComponents,

Expand Down
10 changes: 5 additions & 5 deletions MultiTarget/PackageReferences/Uno.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- This file is modified by UseUnoWinUI.ps1 to switch between WinUI 2 and 3 under Uno Platform -->
<!-- All Uno-based project heads and MultiTarget-enabled library projects need to reference this file, while native (UWP/WinAppSdk) heads don't. -->
<ItemGroup Condition="'$(IsUno)' == 'true'">
<PackageReference Include="Uno.UI" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.WinUI" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.Fonts.Fluent" Version="2.4.5" />
</ItemGroup>

Expand All @@ -15,15 +15,15 @@
</PropertyGroup>

<ItemGroup Condition="'$(IsWasm)' == 'true' OR '$(IsWpf)' == 'true' OR '$(IsGtk)' == 'true'">
<PackageReference Include="Uno.UI.RemoteControl" Version="$(CommonUnoPackageVersion)" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="$(CommonUnoPackageVersion)" Condition="'$(Configuration)'=='Debug'" />
</ItemGroup>

<ItemGroup Condition="'$(IsGtkHead)' == 'true'">
<PackageReference Include="Uno.UI.Skia.Gtk" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.WinUI.Skia.Gtk" Version="$(CommonUnoPackageVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(IsWpfHead)' == 'true'">
<PackageReference Include="Uno.UI.Skia.Wpf" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.WinUI.Skia.Wpf" Version="$(CommonUnoPackageVersion)" />
</ItemGroup>

<PropertyGroup Condition="'$(IsWpfHead)' == 'true'">
Expand All @@ -46,6 +46,6 @@
</PropertyGroup>

<ItemGroup Condition="'$(IsWasmHead)' == 'true'">
<PackageReference Include="Uno.UI.WebAssembly" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.WinUI.WebAssembly" Version="$(CommonUnoPackageVersion)" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions MultiTarget/WinUI.TargetVersion.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<!-- THIS AREA MODIFIED BY SCRIPTS -->
<PackageIdVariant>Uwp</PackageIdVariant>
<WinUIMajorVersion>2</WinUIMajorVersion>
<PackageIdVariant>WinUI</PackageIdVariant>
<WinUIMajorVersion>3</WinUIMajorVersion>
<!-- END SCRIPT AREA -->
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions ProjectHeads/App.Head.Uno.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<DependencyVariant>Uwp</DependencyVariant>
<DependencyVariant>WinUI</DependencyVariant>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\App.Head.props" />
Expand All @@ -9,7 +9,7 @@
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\NoWarn.props" />

<PropertyGroup Condition="'$(IsUno)' == 'true'">
<!-- Code generated by Uno.UI.SourceGenerators creates AoT-unsafe code when Behaviors are used. -->
<!-- Code generated by Uno.WinUI.SourceGenerators creates AoT-unsafe code when Behaviors are used. -->
<NoWarn>$(NoWarn);IL2026</NoWarn>

<!--
Expand All @@ -28,5 +28,5 @@
This import must be inside THIS file to allow swapping between Uno.​UI and Uno.​WinUI via pwsh.
Changes to this file are suppressed by git when switching to avoid changing the default for all users.
-->
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uno.UI.Dependencies.props" />
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uno.WinUI.Dependencies.props" />
</Project>
2 changes: 1 addition & 1 deletion ProjectHeads/GenerateSingleSampleHeads.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Param (
[string[]]$ExcludeMultiTargets,

[Alias("winui")]
[int]$WinUIMajorVersion = 2,
[int]$WinUIMajorVersion = 3,

[Parameter(HelpMessage = "The path to the containing folder for a component where sample heads should be generated.")]
[string]$componentPath,
Expand Down
Loading