From cf315d991a4900d26eeb9b14b1987c51888a1018 Mon Sep 17 00:00:00 2001 From: Mitch Razga Date: Tue, 17 Dec 2024 12:21:49 +1100 Subject: [PATCH 1/3] Remove unsupported .NET targets --- .github/workflows/dotnet.yml | 13 +------------ README.md | 12 ++---------- .../Jab.FunctionalTest.props | 2 +- .../Jab.FunctionalTests.MEDI.csproj | 3 --- src/Jab.Tests/Jab.Tests.csproj | 2 +- src/samples/ConsoleSample/ConsoleSample.csproj | 2 +- 6 files changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f0d4e4c..7acc754 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,9 +20,6 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 3.1.x - 6.0.x - 7.0.x 8.0.x - name: Build run: dotnet build src @@ -55,16 +52,8 @@ jobs: strategy: matrix: sdk: - - 6.0.x - - 7.x - 8.x - # https://github.com/microsoft/MSBuildSdks/issues/412 - # sdk: [6.0.x, 7.0.x] include: - - sdk: 6.0.x - tfm: net6.0 - - sdk: 7.x - tfm: net7.0 - sdk: 8.x tfm: net8.0 runs-on: ubuntu-latest @@ -102,7 +91,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Publish unity packages to npm shell: pwsh run: | diff --git a/README.md b/README.md index 71b83bd..163bff9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Jab provides a [C# Source Generator](https://devblogs.microsoft.com/dotnet/intro - Clean stack traces:
![stacktrace](https://raw.githubusercontent.com/pakrym/jab/main/doc/stacktrace.png) - Readable generated code:
![generated code](https://raw.githubusercontent.com/pakrym/jab/main/doc/generatedcode.png) - Registration validation. Container configuration issues become compiler errors:
![generated code](https://raw.githubusercontent.com/pakrym/jab/main/doc/errors.png) -- Incremental generation, .NET 5/6/7/8 SDK support, .NET Standard 2.0 support, [Unity support](README.md#Unity-installation) +- Incremental generation, Modern .NET SDK support, .NET Standard 2.0 support, [Unity support](README.md#Unity-installation) ## Example @@ -169,18 +169,10 @@ When the scope is disposed all `IDisposable` and `IAsyncDisposable` services tha ### Generic registration attributes -You can use generic attributes to register services if your project targets `net7.0` or `net6.0` and has `LangVersion` set to preview. -```xml - - - - net7.0 - +You can use generic attributes to register services if your project targets a framework compatible with C# 11 or greater. See [C# language versioning](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-versioning#defaults) for more details. - -``` Generic attributes allow declaration to be more compact by avoiding the `typeof` calls: diff --git a/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props b/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props index 2183623..4ad7d3a 100644 --- a/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props +++ b/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props @@ -1,7 +1,7 @@  - netcoreapp3.1;net6.0;net7.0;net8.0;netstandard2.0 + net8.0;netstandard2.0 $(DefaultFunctionalTestTargetFrameworks);net472 $(DefaultFunctionalTestTargetFrameworks) false diff --git a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj index bf99528..f9d8556 100644 --- a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj +++ b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj @@ -9,9 +9,6 @@ - - - diff --git a/src/Jab.Tests/Jab.Tests.csproj b/src/Jab.Tests/Jab.Tests.csproj index e1fb06a..9c389ca 100644 --- a/src/Jab.Tests/Jab.Tests.csproj +++ b/src/Jab.Tests/Jab.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net6.0;net7.0;net8.0 + net8.0 diff --git a/src/samples/ConsoleSample/ConsoleSample.csproj b/src/samples/ConsoleSample/ConsoleSample.csproj index a27f694..54f1db7 100644 --- a/src/samples/ConsoleSample/ConsoleSample.csproj +++ b/src/samples/ConsoleSample/ConsoleSample.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 false From 64ed230a91ea66b259ea10fed72db1f2d9fc8f56 Mon Sep 17 00:00:00 2001 From: Mitch Razga Date: Tue, 17 Dec 2024 12:22:24 +1100 Subject: [PATCH 2/3] Add .NET 9 support --- .github/workflows/dotnet.yml | 6 +++++- src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props | 2 +- .../Jab.FunctionalTests.MEDI.csproj | 1 + src/Jab.Performance/Jab.Performance.csproj | 2 +- src/Jab.Tests/Jab.Tests.csproj | 2 +- src/samples/ConsoleSample/ConsoleSample.csproj | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7acc754..f44808c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,6 +21,7 @@ jobs: with: dotnet-version: | 8.0.x + 9.0.x - name: Build run: dotnet build src - name: Test @@ -53,9 +54,12 @@ jobs: matrix: sdk: - 8.x + - 9.x include: - sdk: 8.x tfm: net8.0 + - sdk: 9.x + tfm: net9.0 runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -91,7 +95,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Publish unity packages to npm shell: pwsh run: | diff --git a/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props b/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props index 4ad7d3a..972c700 100644 --- a/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props +++ b/src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props @@ -1,7 +1,7 @@  - net8.0;netstandard2.0 + net8.0;net9.0;netstandard2.0 $(DefaultFunctionalTestTargetFrameworks);net472 $(DefaultFunctionalTestTargetFrameworks) false diff --git a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj index f9d8556..a32d703 100644 --- a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj +++ b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj @@ -10,5 +10,6 @@ + diff --git a/src/Jab.Performance/Jab.Performance.csproj b/src/Jab.Performance/Jab.Performance.csproj index 6be29b8..fb06843 100644 --- a/src/Jab.Performance/Jab.Performance.csproj +++ b/src/Jab.Performance/Jab.Performance.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 false diff --git a/src/Jab.Tests/Jab.Tests.csproj b/src/Jab.Tests/Jab.Tests.csproj index 9c389ca..0481f4a 100644 --- a/src/Jab.Tests/Jab.Tests.csproj +++ b/src/Jab.Tests/Jab.Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;net9.0 diff --git a/src/samples/ConsoleSample/ConsoleSample.csproj b/src/samples/ConsoleSample/ConsoleSample.csproj index 54f1db7..5bdb271 100644 --- a/src/samples/ConsoleSample/ConsoleSample.csproj +++ b/src/samples/ConsoleSample/ConsoleSample.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 false From 4989ec7deda02e4bcacf7d1a73439724c09b5872 Mon Sep 17 00:00:00 2001 From: Mitch Razga Date: Tue, 17 Dec 2024 12:23:02 +1100 Subject: [PATCH 3/3] Update dependency packages and address transitive dependencies with vulnerabilities --- .../Jab.FunctionalTests.Common.props | 15 ++++++++------- .../Jab.FunctionalTests.MEDI.csproj | 2 +- src/Jab.Performance/Jab.Performance.csproj | 4 ++-- src/Jab.Tests/Jab.Tests.csproj | 12 +++++++----- src/Jab/Jab.csproj | 4 ++-- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/Jab.FunctionalTests.Common/Jab.FunctionalTests.Common.props b/src/Jab.FunctionalTests.Common/Jab.FunctionalTests.Common.props index 37c7e4a..0af7c4e 100644 --- a/src/Jab.FunctionalTests.Common/Jab.FunctionalTests.Common.props +++ b/src/Jab.FunctionalTests.Common/Jab.FunctionalTests.Common.props @@ -3,20 +3,21 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + + + - - + diff --git a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj index a32d703..3db2685 100644 --- a/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj +++ b/src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Jab.Performance/Jab.Performance.csproj b/src/Jab.Performance/Jab.Performance.csproj index fb06843..2e6d3a8 100644 --- a/src/Jab.Performance/Jab.Performance.csproj +++ b/src/Jab.Performance/Jab.Performance.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/src/Jab.Tests/Jab.Tests.csproj b/src/Jab.Tests/Jab.Tests.csproj index 0481f4a..1ba2fe3 100644 --- a/src/Jab.Tests/Jab.Tests.csproj +++ b/src/Jab.Tests/Jab.Tests.csproj @@ -9,17 +9,19 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + + + diff --git a/src/Jab/Jab.csproj b/src/Jab/Jab.csproj index fc9b84f..b68ecc9 100644 --- a/src/Jab/Jab.csproj +++ b/src/Jab/Jab.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -36,7 +36,7 @@ - +