Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-3250: Support .NET 6.0 #1394

Merged
merged 4 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/codeql-csharp-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

# Install .NET SDKs
- name: Install .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test-lang-csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x

- uses: actions/cache@v2
with:
path: ~/.nuget/packages
Expand All @@ -52,6 +60,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x

- name: Cache Local Maven Repository
uses: actions/cache@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ case "$TRAVIS_OS_NAME" in
# Install all (latest) SDKs which are used by multi framework projects
choco install dotnetcore-3.1-sdk # .NET Core 3.1
choco install dotnet-5.0-sdk # .NET 5.0
choco install dotnet-sdk # .NET 6.0
;;
*)
echo "Invalid PLATFORM"
Expand Down
18 changes: 9 additions & 9 deletions lang/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Install-Package Apache.Avro

## Project Target Frameworks

| Project | Type | .NET Framework 4.0 | .NET Standard 2.0 | .NET Standard 2.1 | .NET Core 3.1 | .NET 5.0 |
|:---------------:|:----------:|:------------------:|:------------------:|:-----------------:|:-------------:|:---------:|
| Avro.codegen | Exe | | | | ✔️ |✔️ |
| Avro.ipc | Library | ✔️ | ✔️ | | | |
| Avro.ipc.test | Unit Tests | ✔️ | | | | |
| Avro.main | Library | | ✔️ | ✔️ | | |
| Avro.msbuild | Library | ✔️ | ✔️ | | | |
| Avro.perf | Exe | ✔️ | | | |✔️ |
| Avro.test | Unit Tests | ✔️ | | | ✔️ |✔️ |
| Project | Type | .NET Framework 4.0 | .NET Standard 2.0 | .NET Standard 2.1 | .NET Core 3.1 | .NET 5.0 | .NET 6.0 |
|:---------------:|:----------:|:------------------:|:------------------:|:-----------------:|:-------------:|:---------:|:---------:|
| Avro.codegen | Exe | | | | ✔️ |✔️ |✔️ |
| Avro.ipc | Library | ✔️ | ✔️ | | | | |
| Avro.ipc.test | Unit Tests | ✔️ | | | | | |
| Avro.main | Library | | ✔️ | ✔️ | | | |
| Avro.msbuild | Library | ✔️ | ✔️ | | | | |
| Avro.perf | Exe | ✔️ | | | |✔️ |✔️ |
| Avro.test | Unit Tests | ✔️ | | | ✔️ |✔️ |✔️ |

## 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 net5.0
dotnet run --configuration Release --framework net6.0
;;

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

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

interop-data-test)
Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/src/apache/codegen/Avro.codegen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<!--
Support .NET Core 3.1 (LTS) and .NET 5.0 (latest)
Support .NET Core 3.1 (LTS), .NET 5.0, .NET 6.0 (LTS)
When installing with 'dotnet tool install', the proper/supported framwork will be selected,
unless framework is explicitly specified with 'dotnet tool install'
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install
-->
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<AssemblyName>avrogen</AssemblyName>
<RootNamespace>Avro.codegen</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/src/apache/perf/Avro.perf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks Condition="'$(OS)'!='Windows_NT'">net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'=='Windows_NT'">net461;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'!='Windows_NT'">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'=='Windows_NT'">net461;net6.0</TargetFrameworks>
<AssemblyName>Avro.perf</AssemblyName>
<RootNamespace>Avro.perf</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/src/apache/test/Avro.test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<Import Project="../../../versions.props" />

<PropertyGroup>
<TargetFrameworks Condition="'$(OS)'!='Windows_NT'">netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'=='Windows_NT'">net461;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'!='Windows_NT'">netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)'=='Windows_NT'">net461;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<RootNamespace>Avro.test</RootNamespace>
<AssemblyName>Avro.test</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down
2 changes: 1 addition & 1 deletion lang/csharp/versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<PropertyGroup Label="Build, Test, Code Analysis Package Versions">
<MicrosoftBuildFrameworkVersion>16.8.0</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>16.8.0</MicrosoftBuildUtilitiesCoreVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>5.0.3</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftNETTestSdkVersion>16.11.0</MicrosoftNETTestSdkVersion>
<NUnitVersion>3.13.2</NUnitVersion>
<NUnitConsoleRunnerVersion>3.12.0</NUnitConsoleRunnerVersion>
Expand Down
2 changes: 1 addition & 1 deletion share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-p
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get -qqy install --no-install-recommends dotnet-sdk-3.1 dotnet-sdk-5.0 \
&& apt-get -qqy install --no-install-recommends dotnet-sdk-3.1 dotnet-sdk-5.0 dotnet-sdk-6.0 \
&& apt-get -qqy clean

# Install Ruby
Expand Down