From d5186afe74efcc4e268a64d5088926eb67943aa7 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 13 Nov 2024 12:39:53 +0100 Subject: [PATCH] Migrate projects to .NET 9.0 --- .circleci/config.yml | 12 ++++++------ .github/workflows/ci.yml | 10 +++++----- Dockerfile | 2 +- NetVips.sln | 2 +- appveyor.yml | 6 ++++++ build/NetVips.Build.csproj | 4 +++- docker.sh | 2 +- docs/NetVips.Docs.csproj | 2 +- samples/NetVips.Samples/NetVips.Samples.csproj | 4 ++-- src/NetVips.Extensions/NetVips.Extensions.csproj | 5 ++++- src/NetVips/NetVips.csproj | 5 ++++- tests/NetVips.Benchmarks/Config.cs | 13 +++++-------- tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj | 4 ++-- tests/NetVips.Tests/NetVips.Tests.csproj | 2 +- 14 files changed, 42 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f6a8c1a..69b7c1f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,33 +3,33 @@ version: 2.1 workflows: build: jobs: - - linux-arm64-glibc-net-8: + - linux-arm64-glibc-net-9: filters: tags: only: /^v.*/ - - linux-arm64-musl-net-8: + - linux-arm64-musl-net-9: filters: tags: only: /^v.*/ jobs: - linux-arm64-glibc-net-8: + linux-arm64-glibc-net-9: resource_class: arm.medium machine: image: ubuntu-2204:current steps: - checkout - run: | - sudo docker run -dit --name netvips -e CI -v "$(pwd):/mnt/netvips" -w /mnt/netvips mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm64v8 + sudo docker run -dit --name netvips -e CI -v "$(pwd):/mnt/netvips" -w /mnt/netvips mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim-arm64v8 sudo docker exec netvips sh -c "apt-get update && apt-get install -y fontconfig-config" - run: sudo docker exec netvips bash -c "./build.sh" - linux-arm64-musl-net-8: + linux-arm64-musl-net-9: resource_class: arm.medium machine: image: ubuntu-2204:current steps: - checkout - run: | - sudo docker run -dit --name netvips -e CI -v "$(pwd):/mnt/netvips" -w /mnt/netvips mcr.microsoft.com/dotnet/sdk:8.0-alpine3.19-arm64v8 + sudo docker run -dit --name netvips -e CI -v "$(pwd):/mnt/netvips" -w /mnt/netvips mcr.microsoft.com/dotnet/sdk:9.0-alpine3.20-arm64v8 sudo docker exec netvips sh -c "apk add bash font-noto --update-cache" - run: sudo docker exec netvips bash -c "./build.sh" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df80cf2d..ccf4416b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,13 @@ jobs: matrix: include: - os: ubuntu-22.04 - container: mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim + container: mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim script: ./build.sh - os: ubuntu-22.04 container: rockylinux:8 script: ./build.sh - os: ubuntu-22.04 - container: mcr.microsoft.com/dotnet/sdk:8.0-alpine3.18 + container: mcr.microsoft.com/dotnet/sdk:9.0-alpine3.20 script: ./build.sh - os: macos-13 script: ./build.sh @@ -29,15 +29,15 @@ jobs: apt-get install -y fontconfig-config - name: Dependencies (Rocky Linux 8) if: contains(matrix.container, 'rockylinux') - run: dnf install -y dotnet-sdk-8.0 google-noto-sans-fonts which - - name: Dependencies (Alpine 3.18) + run: dnf install -y dotnet-sdk-9.0 google-noto-sans-fonts which + - name: Dependencies (Alpine 3.20) if: contains(matrix.container, 'alpine') run: apk add bash font-noto --update-cache - name: Setup dotnet (macOS 13, Windows 2022) if: runner.os != 'Linux' uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Checkout uses: actions/checkout@v4 - name: Test diff --git a/Dockerfile b/Dockerfile index ab4ec6cc..fd4cf8de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build LABEL maintainer="Kleis Auke Wolthuizen " RUN apk add bash font-noto --update-cache diff --git a/NetVips.sln b/NetVips.sln index ec189564..bb3bc6c1 100644 --- a/NetVips.sln +++ b/NetVips.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.8.34309.116 +VisualStudioVersion = 17.12.35506.116 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetVips", "src\NetVips\NetVips.csproj", "{5BCB7929-52B1-459B-89E5-7C2059850C60}" EndProject diff --git a/appveyor.yml b/appveyor.yml index c2ba60a0..2757b9ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,12 @@ environment: VIPS_VERSION: "8.16.0" VIPS_WARNING: 0 +# https://github.com/appveyor/ci/issues/3936 +install: + - ps: | + Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1" + & $env:temp\dotnet-install.ps1 -Architecture x64 -Channel 9.0 -InstallDir "$env:ProgramFiles\dotnet" + # Build script build_script: - ps: .\build.ps1 --package diff --git a/build/NetVips.Build.csproj b/build/NetVips.Build.csproj index f52af6c1..765bf6e5 100644 --- a/build/NetVips.Build.csproj +++ b/build/NetVips.Build.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 false False @@ -19,6 +19,8 @@ + + diff --git a/docker.sh b/docker.sh index 90628701..de6af7c4 100755 --- a/docker.sh +++ b/docker.sh @@ -6,7 +6,7 @@ if ! [ -x "$(command -v docker)" ]; then fi # Ensure latest .NET SDK -docker pull mcr.microsoft.com/dotnet/sdk:8.0-alpine +docker pull mcr.microsoft.com/dotnet/sdk:9.0-alpine # Create a machine image with all the required build tools pre-installed docker build . -t netvips diff --git a/docs/NetVips.Docs.csproj b/docs/NetVips.Docs.csproj index e3d477e6..17915ed0 100644 --- a/docs/NetVips.Docs.csproj +++ b/docs/NetVips.Docs.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 x64;x86;ARM64;ARM32 Exe false diff --git a/samples/NetVips.Samples/NetVips.Samples.csproj b/samples/NetVips.Samples/NetVips.Samples.csproj index 8ba4a070..02624f2c 100644 --- a/samples/NetVips.Samples/NetVips.Samples.csproj +++ b/samples/NetVips.Samples/NetVips.Samples.csproj @@ -3,7 +3,7 @@ - net8.0 + net9.0 Exe NetVips true @@ -15,7 +15,7 @@ - + diff --git a/src/NetVips.Extensions/NetVips.Extensions.csproj b/src/NetVips.Extensions/NetVips.Extensions.csproj index 77bfb5a0..8d4f4ac7 100644 --- a/src/NetVips.Extensions/NetVips.Extensions.csproj +++ b/src/NetVips.Extensions/NetVips.Extensions.csproj @@ -21,7 +21,10 @@ - + + diff --git a/src/NetVips/NetVips.csproj b/src/NetVips/NetVips.csproj index 1a46cd08..b60bf4fb 100644 --- a/src/NetVips/NetVips.csproj +++ b/src/NetVips/NetVips.csproj @@ -23,7 +23,10 @@ - + + \ No newline at end of file diff --git a/tests/NetVips.Benchmarks/Config.cs b/tests/NetVips.Benchmarks/Config.cs index e19f96a7..60567e06 100644 --- a/tests/NetVips.Benchmarks/Config.cs +++ b/tests/NetVips.Benchmarks/Config.cs @@ -14,17 +14,14 @@ public Config() // Only support LTS and latest releases // https://endoflife.date/dotnet AddJob(Job.Default -#if NET6_0 - .WithToolchain(CsProjCoreToolchain.NetCoreApp60) - .WithId(".NET 6.0 CLI") -#elif NET7_0 - .WithToolchain(CsProjCoreToolchain.NetCoreApp70) - .WithRuntime(NativeAotRuntime.Net70) - .WithId(".NET 7.0 CLI (NativeAOT)") -#elif NET8_0 +#if NET8_0 .WithToolchain(CsProjCoreToolchain.NetCoreApp80) .WithRuntime(NativeAotRuntime.Net80) .WithId(".NET 8.0 CLI (NativeAOT)") +#elif NET9_0 + .WithToolchain(CsProjCoreToolchain.NetCoreApp90) + .WithRuntime(NativeAotRuntime.Net90) + .WithId(".NET 9.0 CLI (NativeAOT)") #endif #if GLOBAL_VIPS .WithArguments(new Argument[] diff --git a/tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj b/tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj index 77141f3c..7e2b8816 100644 --- a/tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj +++ b/tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj @@ -3,7 +3,7 @@ - net8.0 + net9.0 Exe true x64;x86;ARM64;ARM32 @@ -23,7 +23,7 @@ - + diff --git a/tests/NetVips.Tests/NetVips.Tests.csproj b/tests/NetVips.Tests/NetVips.Tests.csproj index 5c21386a..0aea8417 100644 --- a/tests/NetVips.Tests/NetVips.Tests.csproj +++ b/tests/NetVips.Tests/NetVips.Tests.csproj @@ -3,7 +3,7 @@ - net8.0 + net9.0 false Library x64;x86;ARM64;ARM32