Skip to content

Commit

Permalink
Remove unsupported .NET targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitch Razga authored and Mitch Razga committed Dec 17, 2024
1 parent 61dae13 commit cf315d9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 28 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Jab provides a [C# Source Generator](https://devblogs.microsoft.com/dotnet/intro
- Clean stack traces: <br> ![stacktrace](https://raw.githubusercontent.com/pakrym/jab/main/doc/stacktrace.png)
- Readable generated code: <br> ![generated code](https://raw.githubusercontent.com/pakrym/jab/main/doc/generatedcode.png)
- Registration validation. Container configuration issues become compiler errors: <br> ![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

Expand Down Expand Up @@ -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
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
</PropertyGroup>
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.

</Project>

```

Generic attributes allow declaration to be more compact by avoiding the `typeof` calls:

Expand Down
2 changes: 1 addition & 1 deletion src/Jab.FunctionalTests.Common/Jab.FunctionalTest.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<DefaultFunctionalTestTargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;netstandard2.0</DefaultFunctionalTestTargetFrameworks>
<DefaultFunctionalTestTargetFrameworks>net8.0;netstandard2.0</DefaultFunctionalTestTargetFrameworks>
<DefaultFunctionalTestTargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))" >$(DefaultFunctionalTestTargetFrameworks);net472</DefaultFunctionalTestTargetFrameworks>
<FunctionalTestTargetFrameworks Condition="'$(FunctionalTestTargetFrameworks)' == ''">$(DefaultFunctionalTestTargetFrameworks)</FunctionalTestTargetFrameworks>
<IsPackable>false</IsPackable>
Expand Down
3 changes: 0 additions & 3 deletions src/Jab.FunctionalTests.MEDI/Jab.FunctionalTests.MEDI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' == 'net472'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.0"/>
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.0"/>
<PackageReference Condition="'$(TargetFramework)' == 'netcoreapp3.1'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0"/>
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0"/>
<PackageReference Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0"/>
<PackageReference Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Jab.Tests/Jab.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/samples/ConsoleSample/ConsoleSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit cf315d9

Please sign in to comment.