Skip to content

Commit

Permalink
[WiP] Migrate projects to .NET 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Nov 13, 2024
1 parent bd8d939 commit 0c96ff8
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

RUN apk add bash font-noto --update-cache
Expand Down
2 changes: 1 addition & 1 deletion NetVips.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion build/NetVips.Build.csproj
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>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<IsPackable>False</IsPackable>
Expand All @@ -19,6 +19,8 @@
</PackageReference>
<PackageReference Include="Nuke.Common" Version="8.1.4" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
<!-- https://github.com/nuke-build/nuke/issues/818 -->
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/NetVips.Docs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Platforms>x64;x86;ARM64;ARM32</Platforms>
<OutputType>Exe</OutputType>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
Expand Down
4 changes: 2 additions & 2 deletions samples/NetVips.Samples/NetVips.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>NetVips</RootNamespace>
<Optimize>true</Optimize>
Expand All @@ -15,7 +15,7 @@
<ProjectReference Include="..\..\src\NetVips.Extensions\NetVips.Extensions.csproj" />
</ItemGroup>

<!-- System.Drawing.Common 8.0.0 is only supported on Windows -->
<!-- System.Drawing.Common 6+ is Windows-only -->
<ItemGroup Condition="!$([MSBuild]::IsOSPlatform('Windows'))">
<Compile Remove="Samples/GdiConvert.cs" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/NetVips.Extensions/NetVips.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
<!-- Constrain the version to 8.0.11, as later versions require .NET 8.0.
https://github.com/dotnet/winforms/issues/9851
-->
<PackageReference Include="System.Drawing.Common" Version="[8.0.11]" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Expand Down
5 changes: 4 additions & 1 deletion src/NetVips/NetVips.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Buffers" Version="4.5.1" />
<!-- Constrain the version to 4.5.1, as later versions require .NET Framework 4.6.2.
https://github.com/dotnet/maintenance-packages/issues/42
-->
<PackageReference Include="System.Buffers" Version="[4.5.1]" />
</ItemGroup>

</Project>
13 changes: 5 additions & 8 deletions tests/NetVips.Benchmarks/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
4 changes: 2 additions & 2 deletions tests/NetVips.Benchmarks/NetVips.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<Optimize>true</Optimize>
<Platforms>x64;x86;ARM64;ARM32</Platforms>
Expand All @@ -23,7 +23,7 @@
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.8" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/NetVips.Tests/NetVips.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<OutputType>Library</OutputType>
<Platforms>x64;x86;ARM64;ARM32</Platforms>
Expand Down

0 comments on commit 0c96ff8

Please sign in to comment.