From 2f4f658c84132d11494ac60c73f5ad597e1844d6 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Sat, 8 Jul 2023 15:04:55 +0200 Subject: [PATCH] Drop support for .NET Standard 2.0 and Mono See: https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/ --- .github/workflows/ci.yml | 5 --- CHANGELOG.md | 16 +++++-- README.md | 8 ++-- build/native/NetVips.Native.linux-arm.nuspec | 5 +-- .../native/NetVips.Native.linux-arm64.nuspec | 5 +-- .../NetVips.Native.linux-musl-arm64.nuspec | 3 +- .../NetVips.Native.linux-musl-x64.nuspec | 5 +-- build/native/NetVips.Native.linux-x64.nuspec | 5 +-- build/native/NetVips.Native.nuspec | 17 +------ build/native/NetVips.Native.osx-arm64.nuspec | 3 +- build/native/NetVips.Native.osx-x64.nuspec | 5 +-- build/native/NetVips.Native.win-arm64.nuspec | 3 +- build/native/NetVips.Native.win-x64.nuspec | 4 +- build/native/NetVips.Native.win-x86.nuspec | 4 +- .../targets/NetVips.Native.linux-arm.targets | 18 -------- .../NetVips.Native.linux-arm64.targets | 18 -------- .../NetVips.Native.linux-musl-x64.targets | 18 -------- .../targets/NetVips.Native.linux-x64.targets | 18 -------- .../targets/NetVips.Native.osx-x64.targets | 18 -------- build/test-mono.sh | 45 ------------------- docs/docfx.json | 2 +- .../NetVips.Extensions.csproj | 13 ++---- src/NetVips/ModuleInitializer.cs | 2 + src/NetVips/ModuleInitializerAttribute.cs | 4 +- src/NetVips/NetVips.csproj | 6 +-- tests/NetVips.Tests/NetVips.Tests.csproj | 19 +------- 26 files changed, 43 insertions(+), 226 deletions(-) delete mode 100644 build/native/targets/NetVips.Native.linux-arm.targets delete mode 100644 build/native/targets/NetVips.Native.linux-arm64.targets delete mode 100644 build/native/targets/NetVips.Native.linux-musl-x64.targets delete mode 100644 build/native/targets/NetVips.Native.linux-x64.targets delete mode 100644 build/native/targets/NetVips.Native.osx-x64.targets delete mode 100755 build/test-mono.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0211087..eb1d1231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,6 @@ jobs: - os: ubuntu-22.04 container: mcr.microsoft.com/dotnet/sdk:8.0-alpine3.18 script: ./build.sh - # TODO(kleisauke): Re-enable Mono CI when C# 9 features are supported. - # - os: ubuntu-22.04 - # script: ./build/test-mono.sh - # allow_failures: true - os: macos-12 script: ./build.sh - os: windows-2022 @@ -45,5 +41,4 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Test - continue-on-error: ${{ matrix.allow_failures == true }} run: ${{ matrix.script }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f536de..dd861900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to NetVips will be documented in this file. See [here](CHANG The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.0] - TBD +### Removed +- Drop support for .NET Standard 2.0 and Mono. NetVips now targets .NET 6 (`net6.0`) and .NET Framework 4.5.2 (`net452`) moving forward. + See https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/ for more information. + ## [2.4.2] - 2024-10-13 ### Fixed - Fix incorrect progress reporting on Linux ([#237](https://github.com/kleisauke/net-vips/issues/237)). @@ -31,7 +36,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Changed - Update methods/enums for libvips 8.14. -- The [NetVips.Extensions](https://www.nuget.org/packages/NetVips.Extensions/) package is now only supported on Windows when targeting .NET 6.0 or higher. See https://aka.ms/systemdrawingnonwindows for more information. +- The [NetVips.Extensions](https://www.nuget.org/packages/NetVips.Extensions/) package is now only supported on Windows when targeting .NET 6.0 or higher. + See https://aka.ms/systemdrawingnonwindows for more information. ### Fixed - Ensure compatibility with FreeBSD and variants. @@ -45,13 +51,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Changed - Update methods/enums for libvips 8.13. -- Remove internal `VipsSaveable` enum. - Avoid throwing general exceptions. - Ensure debug and unit tests functions are internal. ### Fixed - Use the correct type for signal handler IDs. +### Removed +- Remove internal `VipsSaveable` enum. + ## [2.1.0] - 2021-12-02 ### Added - Add `image.SignalHandlerDisconnect()` for disconnecting a signal handler. @@ -61,7 +69,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Drop internal `ModuleInit.Fody` dependency in favor of the `[ModuleInitializer]` attribute. - `image.WriteToBuffer()` tries to use the new target API first. - Bump minimum required .NET Framework version to v4.5.2. -- The [NetVips.Extensions](https://www.nuget.org/packages/NetVips.Extensions/) package is now attributed as a Windows-specific library when targeting .NET 6.0 or higher. See https://aka.ms/systemdrawingnonwindows for more information. +- The [NetVips.Extensions](https://www.nuget.org/packages/NetVips.Extensions/) package is now attributed as a Windows-specific library when targeting .NET 6.0 or higher. + See https://aka.ms/systemdrawingnonwindows for more information. ### Fixed - Ensure recorded delegates are not released too early ([#141](https://github.com/kleisauke/net-vips/issues/141)). @@ -228,6 +237,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added - First release! +[3.0.0]: https://github.com/kleisauke/net-vips/compare/v2.4.2...v3.0.0 [2.4.2]: https://github.com/kleisauke/net-vips/compare/v2.4.1...v2.4.2 [2.4.1]: https://github.com/kleisauke/net-vips/compare/v2.4.0...v2.4.1 [2.4.0]: https://github.com/kleisauke/net-vips/compare/v2.3.1...v2.4.0 diff --git a/README.md b/README.md index 1399deed..be9f5ae3 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,7 @@ which gives some more background. ## Supported platforms - .NET Framework 4.5.2 and higher -- .NET Standard 2.0 and higher -- Mono +- .NET 6.0 and higher ## Install @@ -58,7 +57,7 @@ libvips binaries for the most common platforms (see | **Linux ARM64v8 musl**3 | [![NetVips.Native.linux-musl-arm64-badge]][NetVips.Native.linux-musl-arm64-nuget] | | **Linux ARMv7** | [![NetVips.Native.linux-arm-badge]][NetVips.Native.linux-arm-nuget] | | **macOS x64** | [![NetVips.Native.osx-x64-badge]][NetVips.Native.osx-x64-nuget] | -| **macOS ARM64**4 | [![NetVips.Native.osx-arm64-badge]][NetVips.Native.osx-arm64-nuget] | +| **macOS ARM64** | [![NetVips.Native.osx-arm64-badge]][NetVips.Native.osx-arm64-nuget] | [NetVips.Native.win-x64-badge]: https://img.shields.io/nuget/v/NetVips.Native.win-x64.svg [NetVips.Native.win-x64-nuget]: https://www.nuget.org/packages/NetVips.Native.win-x64 @@ -83,8 +82,7 @@ libvips binaries for the most common platforms (see 1 The version number of these NuGet packages is in sync with libvips' version number. 2 Uses glibc as the standard C library (Ubuntu, Debian, etc). -3 Uses musl as the standard C library (Alpine, Gentoo Linux, etc). -4 Requires .NET 6.0 or higher. +3 Uses musl as the standard C library (Alpine, Gentoo Linux, etc). Then just install this package, perhaps: diff --git a/build/native/NetVips.Native.linux-arm.nuspec b/build/native/NetVips.Native.linux-arm.nuspec index 72caaec9..0451a10c 100644 --- a/build/native/NetVips.Native.linux-arm.nuspec +++ b/build/native/NetVips.Native.linux-arm.nuspec @@ -22,9 +22,6 @@ - - - @@ -35,7 +32,7 @@ - + \ No newline at end of file diff --git a/build/native/NetVips.Native.linux-arm64.nuspec b/build/native/NetVips.Native.linux-arm64.nuspec index 5d0ab745..851791d1 100644 --- a/build/native/NetVips.Native.linux-arm64.nuspec +++ b/build/native/NetVips.Native.linux-arm64.nuspec @@ -22,9 +22,6 @@ - - - @@ -35,7 +32,7 @@ - + \ No newline at end of file diff --git a/build/native/NetVips.Native.linux-musl-arm64.nuspec b/build/native/NetVips.Native.linux-musl-arm64.nuspec index 55078f30..ee36a3ae 100644 --- a/build/native/NetVips.Native.linux-musl-arm64.nuspec +++ b/build/native/NetVips.Native.linux-musl-arm64.nuspec @@ -32,8 +32,7 @@ - - + \ No newline at end of file diff --git a/build/native/NetVips.Native.linux-musl-x64.nuspec b/build/native/NetVips.Native.linux-musl-x64.nuspec index cb10a20e..ae087d69 100644 --- a/build/native/NetVips.Native.linux-musl-x64.nuspec +++ b/build/native/NetVips.Native.linux-musl-x64.nuspec @@ -22,9 +22,6 @@ - - - @@ -35,7 +32,7 @@ - + \ No newline at end of file diff --git a/build/native/NetVips.Native.linux-x64.nuspec b/build/native/NetVips.Native.linux-x64.nuspec index 044dd606..caa04483 100644 --- a/build/native/NetVips.Native.linux-x64.nuspec +++ b/build/native/NetVips.Native.linux-x64.nuspec @@ -22,9 +22,6 @@ - - - @@ -35,7 +32,7 @@ - + \ No newline at end of file diff --git a/build/native/NetVips.Native.nuspec b/build/native/NetVips.Native.nuspec index 2e157b2e..b655f72b 100644 --- a/build/native/NetVips.Native.nuspec +++ b/build/native/NetVips.Native.nuspec @@ -21,33 +21,20 @@ - - + - - - - - - - - - - - - - + diff --git a/build/native/NetVips.Native.osx-arm64.nuspec b/build/native/NetVips.Native.osx-arm64.nuspec index 299280d1..74bf7cd9 100644 --- a/build/native/NetVips.Native.osx-arm64.nuspec +++ b/build/native/NetVips.Native.osx-arm64.nuspec @@ -32,8 +32,7 @@ - - + \ No newline at end of file diff --git a/build/native/NetVips.Native.osx-x64.nuspec b/build/native/NetVips.Native.osx-x64.nuspec index 799d6e04..ce4a5866 100644 --- a/build/native/NetVips.Native.osx-x64.nuspec +++ b/build/native/NetVips.Native.osx-x64.nuspec @@ -22,9 +22,6 @@ - - - @@ -35,7 +32,7 @@ - + \ No newline at end of file diff --git a/build/native/NetVips.Native.win-arm64.nuspec b/build/native/NetVips.Native.win-arm64.nuspec index 190a4722..b9d39acf 100644 --- a/build/native/NetVips.Native.win-arm64.nuspec +++ b/build/native/NetVips.Native.win-arm64.nuspec @@ -32,8 +32,7 @@ - - + \ No newline at end of file diff --git a/build/native/NetVips.Native.win-x64.nuspec b/build/native/NetVips.Native.win-x64.nuspec index 1be73f0b..3ff799a0 100644 --- a/build/native/NetVips.Native.win-x64.nuspec +++ b/build/native/NetVips.Native.win-x64.nuspec @@ -22,8 +22,8 @@ - - + + diff --git a/build/native/NetVips.Native.win-x86.nuspec b/build/native/NetVips.Native.win-x86.nuspec index 4c208d2a..3d53872a 100644 --- a/build/native/NetVips.Native.win-x86.nuspec +++ b/build/native/NetVips.Native.win-x86.nuspec @@ -22,8 +22,8 @@ - - + + diff --git a/build/native/targets/NetVips.Native.linux-arm.targets b/build/native/targets/NetVips.Native.linux-arm.targets deleted file mode 100644 index 242b3a50..00000000 --- a/build/native/targets/NetVips.Native.linux-arm.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - $(LibvipsOutputBase)\ - - - - - - $(LibvipsOutputBase)%(Filename)%(Extension) - PreserveNewest - - - - \ No newline at end of file diff --git a/build/native/targets/NetVips.Native.linux-arm64.targets b/build/native/targets/NetVips.Native.linux-arm64.targets deleted file mode 100644 index 62c13e13..00000000 --- a/build/native/targets/NetVips.Native.linux-arm64.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - $(LibvipsOutputBase)\ - - - - - - $(LibvipsOutputBase)%(Filename)%(Extension) - PreserveNewest - - - - \ No newline at end of file diff --git a/build/native/targets/NetVips.Native.linux-musl-x64.targets b/build/native/targets/NetVips.Native.linux-musl-x64.targets deleted file mode 100644 index 84c5c801..00000000 --- a/build/native/targets/NetVips.Native.linux-musl-x64.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - $(LibvipsOutputBase)\ - - - - - - $(LibvipsOutputBase)%(Filename)%(Extension) - PreserveNewest - - - - \ No newline at end of file diff --git a/build/native/targets/NetVips.Native.linux-x64.targets b/build/native/targets/NetVips.Native.linux-x64.targets deleted file mode 100644 index 1696b03c..00000000 --- a/build/native/targets/NetVips.Native.linux-x64.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - $(LibvipsOutputBase)\ - - - - - - $(LibvipsOutputBase)%(Filename)%(Extension) - PreserveNewest - - - - \ No newline at end of file diff --git a/build/native/targets/NetVips.Native.osx-x64.targets b/build/native/targets/NetVips.Native.osx-x64.targets deleted file mode 100644 index 60abfd51..00000000 --- a/build/native/targets/NetVips.Native.osx-x64.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - $(LibvipsOutputBase)\ - - - - - - $(LibvipsOutputBase)%(Filename)%(Extension) - PreserveNewest - - - - \ No newline at end of file diff --git a/build/test-mono.sh b/build/test-mono.sh deleted file mode 100755 index 7265bd1f..00000000 --- a/build/test-mono.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -########################################################################### -# CONFIGURATION -########################################################################### - -BUILD_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) -SCRIPT_DIR=$(dirname "$BUILD_DIR") - -XUNIT_RUNNER="$SCRIPT_DIR/packages/xunit.runner.console/tools/net472/xunit.console.exe" -BUILD_PROJECT_FILE="$SCRIPT_DIR/tests/NetVips.Tests/NetVips.Tests.csproj" -DLL_FILE="$SCRIPT_DIR/tests/NetVips.Tests/bin/Release/net472/NetVips.Tests.dll" - -# https://github.com/dotnet/runtime/issues/11540 -if [ "$(uname)" == "Darwin" ]; then - export DYLD_LIBRARY_PATH=$(dirname "$DLL_FILE")${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} -elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - export LD_LIBRARY_PATH=$(dirname "$DLL_FILE")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} -fi - -# Parse arguments -while [ $# -gt 0 ]; do - case $1 in - --global-vips) USE_NUGET_BINARIES=false ;; - *) echo "Unknown parameter passed: $1" >&2; exit 1 ;; - esac - shift -done - -########################################################################### -# EXECUTION -########################################################################### - -if ! [ -x "$(command -v mono)" ]; then - echo 'Error: mono is not installed.' >&2 - exit 1 -fi - -echo "Mono version $(mono --version)" - -nuget install xunit.runner.console -ExcludeVersion -o packages -msbuild $BUILD_PROJECT_FILE -t:build -restore -p:TargetFramework="net472" -p:Configuration=Release -p:TestWithNuGetBinaries=${USE_NUGET_BINARIES:-true} -nodeReuse:false -mono $XUNIT_RUNNER $DLL_FILE diff --git a/docs/docfx.json b/docs/docfx.json index 1ef8538a..78ded446 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -15,7 +15,7 @@ ], "dest": "obj/temp/api", "properties": { - "TargetFramework": "netstandard2.0" + "TargetFramework": "net6.0" } } ], diff --git a/src/NetVips.Extensions/NetVips.Extensions.csproj b/src/NetVips.Extensions/NetVips.Extensions.csproj index a76ff696..77bfb5a0 100644 --- a/src/NetVips.Extensions/NetVips.Extensions.csproj +++ b/src/NetVips.Extensions/NetVips.Extensions.csproj @@ -3,8 +3,8 @@ - net6.0;netstandard2.0;net461 - netstandard2.0 + net6.0;net461 + net6.0 true NetVips.Extensions NetVips.Extensions @@ -20,17 +20,10 @@ - + - - - - - diff --git a/src/NetVips/ModuleInitializer.cs b/src/NetVips/ModuleInitializer.cs index 43b184b0..1f9e971b 100644 --- a/src/NetVips/ModuleInitializer.cs +++ b/src/NetVips/ModuleInitializer.cs @@ -25,7 +25,9 @@ public static class ModuleInitializer /// /// Initializes the module. /// +#pragma warning disable CA2255 [System.Runtime.CompilerServices.ModuleInitializer] +#pragma warning restore CA2255 public static void Initialize() { try diff --git a/src/NetVips/ModuleInitializerAttribute.cs b/src/NetVips/ModuleInitializerAttribute.cs index 47e805e2..06d6cea3 100644 --- a/src/NetVips/ModuleInitializerAttribute.cs +++ b/src/NetVips/ModuleInitializerAttribute.cs @@ -1,6 +1,6 @@ -// This file enables ModuleInitializer, a C# 9 feature to work with .NET Standard/Framework. +// This file enables ModuleInitializer, a C# 9 feature to work with .NET Framework. -#if NETSTANDARD || NETFRAMEWORK +#if NETFRAMEWORK namespace System.Runtime.CompilerServices { /// diff --git a/src/NetVips/NetVips.csproj b/src/NetVips/NetVips.csproj index 0410589b..4753f587 100644 --- a/src/NetVips/NetVips.csproj +++ b/src/NetVips/NetVips.csproj @@ -3,8 +3,8 @@ - netstandard2.0;net452 - netstandard2.0 + net6.0;net452 + net6.0 true Library @@ -39,7 +39,7 @@ - + diff --git a/tests/NetVips.Tests/NetVips.Tests.csproj b/tests/NetVips.Tests/NetVips.Tests.csproj index 6dda37ec..d6cd2e3a 100644 --- a/tests/NetVips.Tests/NetVips.Tests.csproj +++ b/tests/NetVips.Tests/NetVips.Tests.csproj @@ -14,30 +14,15 @@ false - - - linux-x64 - osx-x64 - - - - - - - - - - - - - + all runtime; build; native; contentfiles; analyzers; buildtransitive +