diff --git a/.github/workflows/codeql-csharp-analysis.yml b/.github/workflows/codeql-csharp-analysis.yml index c140a6e91ab..9faeb04721c 100644 --- a/.github/workflows/codeql-csharp-analysis.yml +++ b/.github/workflows/codeql-csharp-analysis.yml @@ -68,6 +68,7 @@ jobs: 5.0.x 6.0.x 7.0.x + 8.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/test-lang-csharp.yml b/.github/workflows/test-lang-csharp.yml index 87177ca4e2b..27e32717138 100644 --- a/.github/workflows/test-lang-csharp.yml +++ b/.github/workflows/test-lang-csharp.yml @@ -50,6 +50,7 @@ jobs: 5.0.x 6.0.x 7.0.x + 8.0.x - uses: actions/cache@v3 with: @@ -81,6 +82,7 @@ jobs: 5.0.x 6.0.x 7.0.x + 8.0.x - name: Cache Local Maven Repository uses: actions/cache@v3 @@ -133,10 +135,11 @@ jobs: bash ./dotnet-install.sh --channel "5.0" --install-dir "$HOME/.dotnet" # 5.0 bash ./dotnet-install.sh --channel "6.0" --install-dir "$HOME/.dotnet" # 6.0 bash ./dotnet-install.sh --channel "7.0" --install-dir "$HOME/.dotnet" # 7.0 + bash ./dotnet-install.sh --channel "8.0" --install-dir "$HOME/.dotnet" # 8.0 - name: Build run: | set -x export PATH=$HOME/.dotnet:$PATH dotnet --list-sdks - ./build.sh clean test \ No newline at end of file + ./build.sh clean test diff --git a/.github/workflows/test-lang-java.yml b/.github/workflows/test-lang-java.yml index 7aaf1b9ce77..dd536d028fa 100644 --- a/.github/workflows/test-lang-java.yml +++ b/.github/workflows/test-lang-java.yml @@ -119,6 +119,7 @@ jobs: 5.0.x 6.0.x 7.0.x + 8.0.x - name: Install Java Avro for Interop Test working-directory: . @@ -181,4 +182,4 @@ jobs: java -version mvn -version #MAVEN_OPTS="-Dsurefire.excludes=*TestCustomCodec*,*TestAllCodecs*,*TestNettyServer*" ./build.sh clean test - ./build.sh clean test \ No newline at end of file + ./build.sh clean test diff --git a/lang/csharp/README.md b/lang/csharp/README.md index 14a3fa9d4f3..9f6a79c958c 100644 --- a/lang/csharp/README.md +++ b/lang/csharp/README.md @@ -12,25 +12,25 @@ Install-Package Apache.Avro ## Build & Test -1. Install [.NET SDK 5.0+](https://dotnet.microsoft.com/download/dotnet-core) +1. Install [.NET SDK 8.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 Core 3.1 | .NET 5.0 | .NET 6.0 | .NET 7.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 Core 3.1 | .NET 5.0 | .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 | | | ✔️ |✔️ |✔️ |✔️ |✔️ | ## Dependency package version strategy diff --git a/lang/csharp/build.sh b/lang/csharp/build.sh index 82a9bf97de4..2efd4463174 100755 --- a/lang/csharp/build.sh +++ b/lang/csharp/build.sh @@ -42,7 +42,7 @@ do perf) pushd ./src/apache/perf/ - dotnet run --configuration Release --framework net7.0 + dotnet run --configuration Release --framework net8.0 ;; dist) @@ -77,7 +77,7 @@ do ;; interop-data-generate) - dotnet run --project src/apache/test/Avro.test.csproj --framework net7.0 ../../share/test/schemas/interop.avsc ../../build/interop/data + dotnet run --project src/apache/test/Avro.test.csproj --framework net8.0 ../../share/test/schemas/interop.avsc ../../build/interop/data ;; interop-data-test) diff --git a/lang/csharp/common.props b/lang/csharp/common.props index 1874ea2a100..569102df587 100644 --- a/lang/csharp/common.props +++ b/lang/csharp/common.props @@ -37,7 +37,7 @@ - netcoreapp3.1;net5.0;net6.0;net7.0 + netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 netstandard2.0;netstandard2.1 diff --git a/lang/csharp/src/apache/benchmark/Program.cs b/lang/csharp/src/apache/benchmark/Program.cs index 5b63517623c..4359f378d85 100644 --- a/lang/csharp/src/apache/benchmark/Program.cs +++ b/lang/csharp/src/apache/benchmark/Program.cs @@ -21,8 +21,8 @@ namespace Avro.Benchmark { public class Program { - // dotnet run -c Release -f net7.0 - // dotnet run -c Release -f net7.0 --runtimes netcoreapp3.1 net5.0 net6.0 net7.0 + // dotnet run -c Release -f net8.0 + // dotnet run -c Release -f net8.0 --runtimes netcoreapp3.1 net5.0 net6.0 net7.0 net8.0 public static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); diff --git a/lang/csharp/src/apache/test/AvroGen/AvroGenHelper.cs b/lang/csharp/src/apache/test/AvroGen/AvroGenHelper.cs index 04f88617a65..0ce66020717 100644 --- a/lang/csharp/src/apache/test/AvroGen/AvroGenHelper.cs +++ b/lang/csharp/src/apache/test/AvroGen/AvroGenHelper.cs @@ -181,7 +181,18 @@ public static Assembly CompileCSharpFilesAndCheckTypes( if (typeNamesToCheck != null) { // Check if the compiled code has the same number of types defined as the check list - Assert.That(typeNamesToCheck.Count(), Is.EqualTo(assembly.DefinedTypes.Count())); + // Note: Ignore types which are injected by the compiler (System.* and Microsoft.*), e.g. Microsoft.CodeAnalysis.EmbeddedAttribute + Assert.That( + typeNamesToCheck.Count(), + Is.EqualTo( + assembly + .DefinedTypes + .Where(t => + { + return !t.Namespace.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) && + !t.Namespace.StartsWith("System.", StringComparison.OrdinalIgnoreCase); + }) + .Count())); // Check if types available in compiled assembly foreach (string typeName in typeNamesToCheck) diff --git a/lang/csharp/versions.props b/lang/csharp/versions.props index 4acdaa9d759..15dae9ce5a4 100644 --- a/lang/csharp/versions.props +++ b/lang/csharp/versions.props @@ -27,14 +27,16 @@ --> 13.0.1 - 7.0.0 + 8.0.0 4.3.0 4.7.0 4.7.0 - 1.4.1 - 1.3.0 + 1.4.2 + 1.3.1 + 4.1.0 1.1.7 @@ -47,7 +49,8 @@ See https://github.com/apache/avro/pull/1126 & https://github.com/apache/avro/pull/981 for more details --> - 10.0.3 + + 13.0.1 - 0.13.2 - 3.2.0 - 3.2.0 - 17.4.0 - 17.4.0 - 4.3.1 - 4.3.1 - 4.3.1 - 7.0.1 - 17.4.0 - 3.13.3 - 3.15.2 - 4.3.0 + 0.13.10 + 6.0.0 + 6.0.0 + 17.8.3 + 17.8.3 + 4.7.0 + 4.7.0 + 4.7.0 + 8.0.0 + 17.8.0 + 3.14.0 + 3.16.3 + 4.5.0 1.1.118 diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index 1baa92b2603..4973fbe8ea6 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -227,7 +227,8 @@ RUN cd /opt ; \ bash ./dotnet-install.sh --channel "3.1" --install-dir "/opt/dotnet" ; \ bash ./dotnet-install.sh --channel "5.0" --install-dir "/opt/dotnet" ; \ 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 "7.0" --install-dir "/opt/dotnet" ; \ + bash ./dotnet-install.sh --channel "8.0" --install-dir "/opt/dotnet" ; ENV PATH $PATH:/opt/dotnet