Skip to content

Commit

Permalink
Upgrade .NET to 9.0, update config, add TargetFramework.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe committed Nov 18, 2024
1 parent d71b08b commit 3268bed
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 41 deletions.
7 changes: 2 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.208.0/containers/dotnet/.devcontainer/base.Dockerfile

# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal
ARG VARIANT="6.0-bullseye-slim"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
# See https://github.com/devcontainers/images/tree/main/src/dotnet for image choices
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:9.0

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"args": {
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
// Append -bullseye or -focal to pin to an OS version.
"VARIANT": "8.0",
"VARIANT": "9.0",
// Options
"NODE_VERSION": "lts/*"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
workflow_dispatch:

env:
DOTNET_VERSION: ${{ '8.0.x' }}
DOTNET_VERSION: ${{ '9.0.x' }}
ENABLE_DIAGNOSTICS: false
#COREHOST_TRACE: 1
COREHOST_TRACEFILE: corehosttrace.log
Expand Down
22 changes: 11 additions & 11 deletions MultiTarget/AvailableTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project>
<PropertyGroup>
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == ''">uap10.0.17763</UwpTargetFramework>
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0;</WinAppSdkTargetFramework>
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0;</WinAppSdkTargetFramework>

<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0</WpfHeadTargetFramework>
<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0;net9.0;</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0;net9.0;</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0;net9.0;</WpfHeadTargetFramework>

<AndroidLibTargetFramework Condition="'$(AndroidLibTargetFramework)' == ''">net8.0-android34.0</AndroidLibTargetFramework>
<MacOSLibTargetFramework Condition="'$(MacOSLibTargetFramework)' == ''">net8.0-maccatalyst</MacOSLibTargetFramework>
<iOSLibTargetFramework Condition="'$(iOSLibTargetFramework)' == ''">net8.0-ios</iOSLibTargetFramework>
<AndroidLibTargetFramework Condition="'$(AndroidLibTargetFramework)' == ''">net8.0-android34.0;net9.0-android;</AndroidLibTargetFramework>
<MacOSLibTargetFramework Condition="'$(MacOSLibTargetFramework)' == ''">net8.0-maccatalyst;net9.0-maccatalyst;</MacOSLibTargetFramework>
<iOSLibTargetFramework Condition="'$(iOSLibTargetFramework)' == ''">net8.0-ios;net9.0-ios;</iOSLibTargetFramework>

<!-- Used for comparison to current TargetFramework -->
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0</WpfLibTargetFramework>
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0;net9.0;</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0;net9.0;</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0;net9.0;</WpfLibTargetFramework>

<!-- Used for defining TargetFramework under platforms that need it -->
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0</DotnetStandardCommonTargetFramework>
<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net8.0</DotnetCommonTargetFramework>
<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net8.0;net9.0;</DotnetCommonTargetFramework>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions MultiTarget/DefinedConstants.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<DefineConstants Condition="'$(IsWpf)' == 'true'">$(DefineConstants);HAS_UNO_SKIA;__SKIA__;WINDOWS_WPF;</DefineConstants>
<DefineConstants Condition="'$(IsGtk)' == 'true'">$(DefineConstants);HAS_UNO_SKIA;__SKIA__;__GTK__;</DefineConstants>

<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">$(DefineConstants);NET9_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">$(DefineConstants);NET8_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">$(DefineConstants);NET7_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">$(DefineConstants);NET6_0_OR_GREATER</DefineConstants>
Expand Down
20 changes: 10 additions & 10 deletions MultiTarget/EnabledTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project>
<PropertyGroup>
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == ''">uap10.0.17763</UwpTargetFramework>
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0;</WinAppSdkTargetFramework>

<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0</WpfHeadTargetFramework>
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0;</WinAppSdkTargetFramework>

<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net8.0;net9.0;</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net8.0;net9.0;</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net8.0;net9.0;</WpfHeadTargetFramework>





<!-- Used for comparison to current TargetFramework -->
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0</WpfLibTargetFramework>
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net8.0;net9.0;</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net8.0;net9.0;</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net8.0;net9.0;</WpfLibTargetFramework>

<!-- Used for defining TargetFramework under platforms that need it -->
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0</DotnetStandardCommonTargetFramework>
<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net8.0</DotnetCommonTargetFramework>

<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net8.0;net9.0;</DotnetCommonTargetFramework>
</PropertyGroup>
</Project>
20 changes: 10 additions & 10 deletions MultiTarget/MultiTargetIdentifiers.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@
<MultiTargetsWasdk Condition="$(MultiTarget.Contains('wasdk')) == 'true'">true</MultiTargetsWasdk>
<MultiTargetsNetstandard Condition="$(MultiTarget.Contains('netstandard')) == 'true'">true</MultiTargetsNetstandard>

<IsWasmHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWasmHead)' == '' AND '$(TargetFramework)' == '$(WasmHeadTargetFramework)' AND '$(WasmHeadTargetFramework)' != ''">true</IsWasmHead>
<IsWasmLib Condition="'$(IsWasmLib)' == '' AND '$(TargetFramework)' == '$(WasmLibTargetFramework)' AND '$(MultiTargetsWasm)' == 'true' AND '$(WasmLibTargetFramework)' != ''">true</IsWasmLib>
<IsWasmHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWasmHead)' == '' AND $(WasmHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(WasmHeadTargetFramework)' != ''">true</IsWasmHead>
<IsWasmLib Condition="'$(IsWasmLib)' == '' AND $(WasmHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(MultiTargetsWasm)' == 'true' AND '$(WasmLibTargetFramework)' != ''">true</IsWasmLib>
<IsWasm Condition="'$(IsWasm)' == '' AND ('$(IsWasmHead)' == 'true' or '$(IsWasmLib)' == 'true')">true</IsWasm>

<IsWpfHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWpfHead)' == '' AND '$(TargetFramework)' == '$(WpfHeadTargetFramework)' AND '$(WpfHeadTargetFramework)' != ''">true</IsWpfHead>
<IsWpfLib Condition="'$(IsWpfLib)' == '' AND '$(TargetFramework)' == '$(WpfLibTargetFramework)' AND '$(WpfLibTargetFramework)' != '' AND '$(MultiTargetsWpf)' == 'true'">true</IsWpfLib>
<IsWpfHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWpfHead)' == '' AND $(WpfHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(WpfHeadTargetFramework)' != ''">true</IsWpfHead>
<IsWpfLib Condition="'$(IsWpfLib)' == '' AND $(WpfLibTargetFramework.Contains('$(TargetFramework);')) AND '$(WpfLibTargetFramework)' != '' AND '$(MultiTargetsWpf)' == 'true'">true</IsWpfLib>
<IsWpf Condition="'$(IsWpf)' == '' AND ('$(IsWpfHead)' == 'true' or '$(IsWpfLib)' == 'true')">true</IsWpf>

<IsGtkHead Condition="$(IsDeployableHead) == 'true' AND '$(IsGtkHead)' == '' AND '$(TargetFramework)' == '$(LinuxHeadTargetFramework)' AND '$(LinuxHeadTargetFramework)' != ''">true</IsGtkHead>
<IsGtkLib Condition="'$(IsGtkLib)' == '' AND '$(TargetFramework)' == '$(LinuxLibTargetFramework)' AND '$(LinuxLibTargetFramework)' != '' AND '$(MultiTargetsLinuxGtk)' == 'true'">true</IsGtkLib>
<IsGtkHead Condition="$(IsDeployableHead) == 'true' AND '$(IsGtkHead)' == '' AND $(LinuxHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(LinuxHeadTargetFramework)' != ''">true</IsGtkHead>
<IsGtkLib Condition="'$(IsGtkLib)' == '' AND $(LinuxLibTargetFramework.Contains('$(TargetFramework);')) AND '$(LinuxLibTargetFramework)' != '' AND '$(MultiTargetsLinuxGtk)' == 'true'">true</IsGtkLib>
<IsGtk Condition="'$(IsGtk)' == '' AND ('$(IsGtkHead)' == 'true' or '$(IsGtkLib)' == 'true')">true</IsGtk>

<IsUwp Condition="'$(IsUwp)' == '' AND '$(TargetFramework)' == '$(UwpTargetFramework)' AND '$(UwpTargetFramework)' != '' AND '$(MultiTargetsUwp)' == 'true'">true</IsUwp>
<IsWinAppSdk Condition="'$(IsWinAppSdk)' == '' AND $(WinAppSdkTargetFramework.Contains('$(TargetFramework);')) AND '$(WinAppSdkTargetFramework)' != '' AND '$(MultiTargetsWasdk)' == 'true'">true</IsWinAppSdk>

<IsDroid Condition="'$(IsDroid)' == '' AND '$(TargetFramework)' == '$(AndroidLibTargetFramework)' AND '$(AndroidLibTargetFramework)' != '' AND '$(MultiTargetsDroid)' == 'true'">true</IsDroid>
<IsMacOS Condition="'$(IsMacOS)' == '' AND '$(TargetFramework)' == '$(MacOSLibTargetFramework)' AND '$(MacOSLibTargetFramework)' != '' AND '$(MultiTargetsMacOS)' == 'true'">true</IsMacOS>
<IsiOS Condition="'$(IsiOS)' == '' AND '$(TargetFramework)' == '$(iOSLibTargetFramework)' AND '$(iOSLibTargetFramework)' != '' AND '$(MultiTargetsiOS)' == 'true'">true</IsiOS>
<IsNetstandard Condition="'$(IsNetstandard)' == '' AND '$(TargetFramework)' == '$(DotnetStandardCommonTargetFramework)' AND '$(MultiTargetsNetstandard)' == 'true'">true</IsNetstandard>
<IsDroid Condition="'$(IsDroid)' == '' AND $(AndroidLibTargetFramework.Contains('$(TargetFramework);')) AND '$(AndroidLibTargetFramework)' != '' AND '$(MultiTargetsDroid)' == 'true'">true</IsDroid>
<IsMacOS Condition="'$(IsMacOS)' == '' AND $(MacOSLibTargetFramework.Contains('$(TargetFramework);')) AND '$(MacOSLibTargetFramework)' != '' AND '$(MultiTargetsMacOS)' == 'true'">true</IsMacOS>
<IsiOS Condition="'$(IsiOS)' == '' AND $(iOSLibTargetFramework.Contains('$(TargetFramework);')) AND '$(iOSLibTargetFramework)' != '' AND '$(MultiTargetsiOS)' == 'true'">true</IsiOS>
<IsNetstandard Condition="'$(IsNetstandard)' == '' AND $(DotnetStandardCommonTargetFramework.Contains('$(TargetFramework);')) AND '$(MultiTargetsNetstandard)' == 'true'">true</IsNetstandard>

<IsUno Condition="'$(IsWasm)' == 'true' OR '$(IsWpf)' == 'true' OR '$(IsGtk)' == 'true' OR '$(IsDroid)' == 'true' OR '$(IsMacOS)' == 'true' OR '$(IsiOS)' == 'true'">true</IsUno>

Expand Down
4 changes: 2 additions & 2 deletions MultiTarget/PackageReferences/Uno.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<CommonUnoPackageVersion>5.2.132</CommonUnoPackageVersion>
<CommonUnoPackageVersion>5.5.66</CommonUnoPackageVersion>
</PropertyGroup>

<!-- 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.Fonts.Fluent" Version="2.3.0" />
<PackageReference Include="Uno.Fonts.Fluent" Version="2.4.5" />
</ItemGroup>

<PropertyGroup Condition="'$(IsUno)' == 'true'">
Expand Down
1 change: 1 addition & 0 deletions MultiTarget/WinUI.Extra.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<!-- Workaround, improved error message when consuming from Uno projects with mismatched TFMs -->
<!-- See https://github.com/CommunityToolkit/Windows/issues/388 -->
<ItemGroup>
<None PackagePath="lib/net9.0-windows10.0.18362" Include="$(MSBuildThisFileDirectory)/_._" Pack="true" />
<None PackagePath="lib/net8.0-windows10.0.18362" Include="$(MSBuildThisFileDirectory)/_._" Pack="true" />
<None PackagePath="lib/net7.0-windows10.0.18362" Include="$(MSBuildThisFileDirectory)/_._" Pack="true" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.403",
"version": "9.0.100",
"rollForward": "latestFeature"
},
"msbuild-sdks":
Expand Down

0 comments on commit 3268bed

Please sign in to comment.