Skip to content
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

Update all samples to .NET 9, fix warnings #871

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
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
18 changes: 9 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@ jobs:
- name: Build and run ComputeSharp.Sample
run: >
dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.exe
samples\ComputeSharp.Sample\bin\x64\Release\net9.0\win-x64\ComputeSharp.Sample.exe
- name: Build and run ComputeSharp.Sample.FSharp
run: >
dotnet build samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.FSharp.exe
samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net9.0\win-x64\ComputeSharp.Sample.FSharp.exe
- name: Build and run ComputeSharp.ImageProcessing.csproj
run: >
dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.ImageProcessing\bin\x64\Release\net8.0\win-x64\ComputeSharp.ImageProcessing.exe
samples\ComputeSharp.ImageProcessing\bin\x64\Release\net9.0\win-x64\ComputeSharp.ImageProcessing.exe

# Run the NativeAOT samples as well
run-samples-aot:
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.Cli (speed)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net9.0\win-x64\publish\computesharp.cli.exe -PassThru);
sleep -Seconds 2;
try
{
Expand All @@ -246,7 +246,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: computesharp.cli.opt-speed.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net9.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error

# Publish the NativeAOT CLI sample (optimized for size, and reflection-free)
Expand All @@ -262,7 +262,7 @@ jobs:
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.Cli (size)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net9.0\win-x64\publish\computesharp.cli.exe -PassThru);
sleep -Seconds 2;
try
{
Expand All @@ -278,7 +278,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: computesharp.cli.opt-size.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net9.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error

# Also publish the Win2D sample (with R2R)
Expand All @@ -294,7 +294,7 @@ jobs:
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.D2D1.Cli (R2R)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net9.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
sleep -Seconds 2;
try
{
Expand All @@ -317,7 +317,7 @@ jobs:
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.D2D1.Cli (NativeAOT)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net9.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
sleep -Seconds 2;
try
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
<Platforms>x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<!-- NativeAOT configuration -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>9.0</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-->
<OutputType Condition="'$(CI_RUNNER_SAMPLES_INTEGRATION_TESTS)' == 'true'">Exe</OutputType>
<OutputType Condition="'$(CI_RUNNER_SAMPLES_INTEGRATION_TESTS)' != 'true'">WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Platforms>x64;ARM64</Platforms>
<AssemblyName>computesharp.cli</AssemblyName>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType Condition="'$(CI_RUNNER_SAMPLES_INTEGRATION_TESTS)' == 'true'">Exe</OutputType>
<OutputType Condition="'$(CI_RUNNER_SAMPLES_INTEGRATION_TESTS)' != 'true'">WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621</TargetFramework>
<TargetFramework>net9.0-windows10.0.22621</TargetFramework>
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x64;ARM64</Platforms>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
<UseUwp>true</UseUwp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.57</WindowsSdkPackageVersion>
<UseUwp>true</UseUwp>
Expand Down Expand Up @@ -49,8 +49,8 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="CommunityToolkit.Uwp.Controls.Primitives" Version="8.2.241221-build.1360" />
<PackageReference Include="CommunityToolkit.Uwp.Media" Version="8.2.241221-build.1360" />
<PackageReference Include="CommunityToolkit.Uwp.Controls.Primitives" Version="8.2.241223-build.1367" />
<PackageReference Include="CommunityToolkit.Uwp.Media" Version="8.2.241223-build.1367" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />

<!-- Remove all WebView2 assets (transitive from WinUI 2), since we don't need it at all -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand All @@ -11,6 +11,12 @@
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>

<!--
Temporary workaround for the XAML compiler generating 'RuntimeHelpers.RunClassConstructor' stubs for 'Nullable<T>' types.
This has been fixed already (see: https://github.com/dotnet/runtime/issues/106939). XAML compiler update coming soon too.
-->
<NoWarn>$(NoWarn);IL2059</NoWarn>

<!--
WinUI 3 doesn't need support for 'INotifyPropertyChanging', so we can disable it.
This avoids all generated code for it and provides a small performance improvement.
Expand Down Expand Up @@ -51,8 +57,8 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.241112-preview1" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.241112-preview1" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.241223-build.1367" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.241223-build.1367" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Platforms>x64;ARM64</Platforms>
</PropertyGroup>

Expand Down
Loading