Skip to content

Commit

Permalink
Support .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoltan Csizmadia authored and Zoltan Csizmadia committed Oct 30, 2024
1 parent 96644c5 commit 94e4cee
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/codeql-csharp-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-lang-csharp-ARM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -79,6 +81,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

- name: Cache Local Maven Repository
uses: actions/cache@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-lang-csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -79,6 +81,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

- name: Cache Local Maven Repository
uses: actions/cache@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-lang-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'

- name: 'Create Interop Data Directory'
working-directory: .
Expand Down
30 changes: 15 additions & 15 deletions lang/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ Install-Package Apache.Avro

## Build & Test

1. Install [.NET SDK 8.0+](https://dotnet.microsoft.com/download/dotnet-core)
1. Install [.NET SDK 9.0+](https://dotnet.microsoft.com/download/dotnet-core)
2. `dotnet test`

## Project Target Frameworks

| Project | Published to nuget.org | Type | .NET Standard 2.0 | .NET Standard 2.1 | .NET 6.0 | .NET 7.0 | .NET 8.0 |
|:-------------------:|:--------------------------:|:----------:|:------------------:|:-----------------:|:---------:|:---------:|:---------:|
| Avro.main | Apache.Avro | Library | ✔️ | ✔️ | | | |
| Avro.File.Snappy | Apache.Avro.File.Snappy | Library | ✔️ | ✔️ | | | |
| Avro.File.BZip2 | Apache.Avro.File.BZip2 | Library | ✔️ | ✔️ | | | |
| Avro.File.XZ | Apache.Avro.File.XZ | Library | ✔️ | ✔️ | | | |
| Avro.File.Zstandard | Apache.Avro.File.Zstandard | Library | ✔️ | ✔️ | | | |
| Avro.codegen | Apache.Avro.Tools | Exe | | |✔️ |✔️ |✔️ |
| Avro.ipc | | Library | ✔️ | ✔️ | | | |
| Avro.ipc.test | | Unit Tests | | |✔️ |✔️ |✔️ |
| Avro.msbuild | | Library | ✔️ | ✔️ | | | |
| Avro.perf | | Exe | | |✔️ |✔️ |✔️ |
| Avro.test | | Unit Tests | | |✔️ |✔️ |✔️ |
| Avro.benchmark | | Exe | | |✔️ |✔️ |✔️ |
| Project | Published to nuget.org | Type | .NET Standard 2.0 | .NET Standard 2.1 | .NET 6.0 | .NET 7.0 | .NET 8.0 | NET 9.0 |
|:-------------------:|:--------------------------:|:----------:|:------------------:|:-----------------:|:---------:|:---------:|:---------:|:---------:|
| Avro.main | Apache.Avro | Library | ✔️ | ✔️ | | | | |
| Avro.File.Snappy | Apache.Avro.File.Snappy | Library | ✔️ | ✔️ | | | | |
| Avro.File.BZip2 | Apache.Avro.File.BZip2 | Library | ✔️ | ✔️ | | | | |
| Avro.File.XZ | Apache.Avro.File.XZ | Library | ✔️ | ✔️ | | | | |
| Avro.File.Zstandard | Apache.Avro.File.Zstandard | Library | ✔️ | ✔️ | | | | |
| Avro.codegen | Apache.Avro.Tools | Exe | | |✔️ |✔️ |✔️ |✔️ |
| Avro.ipc | | Library | ✔️ | ✔️ | | | | |
| Avro.ipc.test | | Unit Tests | | |✔️ |✔️ |✔️ |✔️ |
| Avro.msbuild | | Library | ✔️ | ✔️ | | | | |
| Avro.perf | | Exe | | |✔️ |✔️ |✔️ |✔️ |
| Avro.test | | Unit Tests | | |✔️ |✔️ |✔️ |✔️ |
| Avro.benchmark | | Exe | | |✔️ |✔️ |✔️ |✔️ |

## Dependency package version strategy

Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ do

perf)
pushd ./src/apache/perf/
dotnet run --configuration Release --framework net8.0
dotnet run --configuration Release --framework net9.0
;;

dist)
Expand Down Expand Up @@ -77,7 +77,7 @@ do
;;

interop-data-generate)
dotnet run --project src/apache/test/Avro.test.csproj --framework net8.0 ../../share/test/schemas/interop.avsc ../../build/interop/data
dotnet run --project src/apache/test/Avro.test.csproj --framework net9.0 ../../share/test/schemas/interop.avsc ../../build/interop/data
;;

interop-data-test)
Expand Down
2 changes: 1 addition & 1 deletion lang/csharp/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<PropertyGroup Label="Target Frameworks">
<!-- Exe -->
<DefaultExeTargetFrameworks>net6.0;net7.0;net8.0</DefaultExeTargetFrameworks>
<DefaultExeTargetFrameworks>net6.0;net7.0;net8.0;net9.0</DefaultExeTargetFrameworks>
<!-- Library -->
<DefaultLibraryTargetFrameworks>netstandard2.0;netstandard2.1</DefaultLibraryTargetFrameworks>
<!-- Unit Tests -->
Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/src/apache/benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace Avro.Benchmark
{
public class Program
{
// dotnet run -c Release -f net8.0
// dotnet run -c Release -f net8.0 --runtimes net6.0 net7.0 net8.0
// dotnet run -c Release -f net9.0
// dotnet run -c Release -f net9.0 --runtimes net6.0 net7.0 net9.0
public static void Main(string[] args)
{
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
Expand Down
22 changes: 11 additions & 11 deletions lang/csharp/versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
!!! SHIPPED CLASS LIBRARIES SHOULD USE MINIMUMVERSIONs FOR SOME LIBRARIES. SEE BELOW !!!
-->
<PropertyGroup Label="Latest Package Versions">
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<SystemCodeDomVersion>8.0.0</SystemCodeDomVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<SystemCodeDomVersion>9.0.0-rc.2.24473.5</SystemCodeDomVersion>
<SystemReflectionVersion>4.3.0</SystemReflectionVersion>
<SystemReflectionEmitILGenerationVersion>4.7.0</SystemReflectionEmitILGenerationVersion>
<SystemReflectionEmitLightweightVersion>4.7.0</SystemReflectionEmitLightweightVersion>
Expand Down Expand Up @@ -58,15 +58,15 @@
Please sort the packages alphabetically
-->
<PropertyGroup Label="Build, Test, Code Analysis, Benchmark Package Versions">
<BenchmarkDotNetVersion>0.13.10</BenchmarkDotNetVersion>
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
<CoverletMSBuildVersion>6.0.0</CoverletMSBuildVersion>
<MicrosoftBuildFrameworkVersion>17.8.3</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>17.8.3</MicrosoftBuildUtilitiesCoreVersion>
<MicrosoftCodeAnalysisVersion>4.7.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.7.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>4.7.0</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<BenchmarkDotNetVersion>0.14.0</BenchmarkDotNetVersion>
<CoverletCollectorVersion>6.0.2</CoverletCollectorVersion>
<CoverletMSBuildVersion>6.0.2</CoverletMSBuildVersion>
<MicrosoftBuildFrameworkVersion>17.12.6</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>17.12.6</MicrosoftBuildUtilitiesCoreVersion>
<MicrosoftCodeAnalysisVersion>4.11.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.11.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>4.11.0</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24454.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftNETTestSdkVersion>17.8.0</MicrosoftNETTestSdkVersion>
<NUnitVersion>3.14.0</NUnitVersion>
<NUnitConsoleRunnerVersion>3.16.3</NUnitConsoleRunnerVersion>
Expand Down
3 changes: 2 additions & 1 deletion share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ RUN cd /opt ; \
wget https://dot.net/v1/dotnet-install.sh ; \
bash ./dotnet-install.sh --channel "6.0" --install-dir "/opt/dotnet" ; \
bash ./dotnet-install.sh --channel "7.0" --install-dir "/opt/dotnet" ; \
bash ./dotnet-install.sh --channel "8.0" --install-dir "/opt/dotnet" ;
bash ./dotnet-install.sh --channel "8.0" --install-dir "/opt/dotnet" ; \
bash ./dotnet-install.sh --channel "9.0" --install-dir "/opt/dotnet" ;

ENV PATH $PATH:/opt/dotnet

Expand Down

0 comments on commit 94e4cee

Please sign in to comment.