From a83f93228360a8711a27b41c49a0e641a07234d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20O=2E=20S=C3=B8rensen?= Date: Wed, 5 Aug 2026 01:03:40 +0200 Subject: [PATCH] build: Multi-target net8.0 and net10.0 LibLouis.NET and the test project build for both. The extensions packages are referenced per target framework, 8.0.2 for net8.0 and 10.0.10 for net10.0, so a net10.0 consumer does not drag an older set into its dependency graph. The runtime packages stay on netstandard2.0: they carry no managed code, and netstandard2.0 is the widest thing to be compatible with. Microsoft.NET.Test.Sdk moves to 18.8.1, the first version that supports net10.0. Packing a multi-targeted project runs the cross-targeting outer build, which has no default None items, so the existing matched nothing there and the licence silently never reached the package (NU5030). The inner builds do have the item, where a second Include would be a duplicate, so both forms are present and conditioned on whether TargetFramework is set. The container's own SDK version is deliberately not touched here. It compiles C and runs dotnet pack, and which SDK does the packing barely affects the output; moving it belongs with the Dockerfile restructure that separates compiling from packing, not with the multi-targeting. Verified: both target frameworks build and pass, and the package carries lib/net8.0 and lib/net10.0 with matching per-TFM dependency groups. Co-Authored-By: Claude Opus 5 --- .github/workflows/build.yml | 16 ++++++++++++---- LibLouis.NET.Test/LibLouis.NET.Test.csproj | 7 ++++--- LibLouis.NET/LibLouis.NET.csproj | 22 +++++++++++++++------- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e322ae2..542f473 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,9 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: | + 8.0.x + 10.0.x - name: Build and pack run: sh ./build/build_runtime_macos_packages.sh @@ -80,7 +82,9 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: | + 8.0.x + 10.0.x - name: Collect runtime packages into a local feed uses: actions/download-artifact@v4 @@ -115,7 +119,9 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: | + 8.0.x + 10.0.x - name: Collect runtime packages into a local feed uses: actions/download-artifact@v4 @@ -152,7 +158,9 @@ jobs: steps: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: | + 8.0.x + 10.0.x - uses: actions/download-artifact@v4 with: diff --git a/LibLouis.NET.Test/LibLouis.NET.Test.csproj b/LibLouis.NET.Test/LibLouis.NET.Test.csproj index 8dee374..bf607e2 100644 --- a/LibLouis.NET.Test/LibLouis.NET.Test.csproj +++ b/LibLouis.NET.Test/LibLouis.NET.Test.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;net10.0 enable false true @@ -12,8 +12,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + all diff --git a/LibLouis.NET/LibLouis.NET.csproj b/LibLouis.NET/LibLouis.NET.csproj index 96e70b3..c75c311 100644 --- a/LibLouis.NET/LibLouis.NET.csproj +++ b/LibLouis.NET/LibLouis.NET.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;net10.0 enable True Nota @@ -20,8 +20,12 @@ - - + + + + + + +