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

feat: Add Targets for NET6 and NetStandard 2.1 | Bump packages #404

Closed
wants to merge 4 commits into from
Closed
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
18 changes: 12 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AutoFixture" Version="4.17.0" />
<PackageVersion Include="AutoFixture" Version="4.18.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="Constant" Version="2.0.4" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="coverlet.msbuild" Version="3.2.0" />
<PackageVersion Include="Dapper" Version="2.1.15" />
<PackageVersion Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Dapper" Version="2.1.15" />
<PackageVersion Include="Enums.NET" Version="4.0.1" />
<PackageVersion Include="FluentAssertions" Version="6.11.0" />
<PackageVersion Include="MessagePack" Version="2.4.59" />
<PackageVersion Include="MessagePack" Version="2.5.108" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="7.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.13" />
Expand All @@ -20,7 +26,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="protobuf-net" Version="3.2.26" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.12.0.78982" />
<PackageVersion Include="System.Text.Json" Version="7.0.3" />
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Install-Package Ardalis.SmartEnum.Dapper

## Version

The latest version of the package supports .NET 7. If you don't need or aren't yet ready to move to .NET 7 or later, you should install the previous stable version, [Ardalis.SmartEnum 2.1](https://www.nuget.org/packages/Ardalis.SmartEnum/2.1.0).
The latest version of the package multi-targets `.NET7`, `.NET6` and `.NetStandard2.1` (Excluding the EFCore package which is incompatbile with .NetStandard 2.1).
If you don't need or aren't yet ready to move to .NET 7 or later, you should install the previous stable version, [Ardalis.SmartEnum 2.1](https://www.nuget.org/packages/Ardalis.SmartEnum/2.1.0).

Example package manager command:

Expand Down
2 changes: 0 additions & 2 deletions SmartEnum.sln
ardalis marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{E4
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
azure-pipelines.yml = azure-pipelines.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
LICENSE = LICENSE
nuget.txt = nuget.txt
README.md = README.md
SmartEnumTests.ruleset = SmartEnumTests.ruleset
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmartEnum.Benchmarks", "benchmarks\SmartEnum.Benchmarks\SmartEnum.Benchmarks.csproj", "{0F0C288D-39BA-4E83-A7FE-3B90D7CF250A}"
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/SmartEnum.Benchmarks/SmartEnum.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Constant" />
<PackageReference Include="Enums.NET" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Constant" />
<PackageReference Include="Enums.NET" />
<ProjectReference Include="..\..\src\SmartEnum.MessagePack\SmartEnum.MessagePack.csproj" />
<ProjectReference Include="..\..\src\SmartEnum\SmartEnum.csproj" />
<ProjectReference Include="..\..\src\SmartEnum.JsonNet\SmartEnum.JsonNet.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions src/SmartEnum.AutoFixture/SmartEnum.AutoFixture.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<PackageReleaseNotes>Updating to net7</PackageReleaseNotes>
<AssemblyName>Ardalis.SmartEnum.AutoFixture</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.AutoFixture</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
3 changes: 3 additions & 0 deletions src/SmartEnum.Dapper/SmartEnum.Dapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
<PackageTags>enum;smartenum;dapper;ardalis</PackageTags>
<PackageReleaseNotes>Updating to net7.</PackageReleaseNotes>
<PackageIcon>icon.png</PackageIcon>
<LangVersion>11.0</LangVersion>
<AssemblyName>Ardalis.SmartEnum.Dapper</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.Dapper</RootNamespace>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
1 change: 1 addition & 0 deletions src/SmartEnum.EFCore/SmartEnum.EFCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AssemblyName>Ardalis.SmartEnum.EFCore</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.EFCore</RootNamespace>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
4 changes: 3 additions & 1 deletion src/SmartEnum.JsonNet/SmartEnum.JsonNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<PackageIcon>icon.png</PackageIcon>
<AssemblyName>Ardalis.SmartEnum.JsonNet</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.JsonNet</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="All" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/SmartEnum.MessagePack/SmartEnum.MessagePack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<PackageIcon>icon.png</PackageIcon>
<AssemblyName>Ardalis.SmartEnum.MessagePack</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.MessagePack</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
8 changes: 5 additions & 3 deletions src/SmartEnum.ModelBinding/SmartEnum.ModelBinding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
<PackageIcon>icon.png</PackageIcon>
<PackageReleaseNotes>Updating to net7.</PackageReleaseNotes>
<AssemblyName>Ardalis.SmartEnum.ModelBinding</AssemblyName>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SmartEnum\SmartEnum.csproj"/>
<ProjectReference Include="..\SmartEnum\SmartEnum.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="$(SolutionDir)img\icon.png" Pack="true" Visible="false" PackagePath=""/>
<None Include="$(SolutionDir)img\icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/SmartEnum.ProtoBufNet/SmartEnum.ProtoBufNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<PackageIcon>icon.png</PackageIcon>
<AssemblyName>Ardalis.SmartEnum.ProtoBufNet</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.ProtoBufNet</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
2 changes: 2 additions & 0 deletions src/SmartEnum.SystemTextJson/SmartEnum.SystemTextJson.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<PackageReleaseNotes>Updating to net7.</PackageReleaseNotes>
<AssemblyName>Ardalis.SmartEnum.SystemTextJson</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.SystemTextJson</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
2 changes: 2 additions & 0 deletions src/SmartEnum.Utf8Json/SmartEnum.Utf8Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<PackageIcon>icon.png</PackageIcon>
<AssemblyName>Ardalis.SmartEnum.Utf8Json</AssemblyName>
<RootNamespace>Ardalis.SmartEnum.Utf8Json</RootNamespace>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion src/SmartEnum/SmartEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public virtual int CompareTo(SmartEnum<TEnum, TValue> other) =>

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator TValue(SmartEnum<TEnum, TValue> smartEnum) =>
smartEnum is not null
smartEnum != null
? smartEnum._value
: default;

Expand Down
2 changes: 2 additions & 0 deletions src/SmartEnum/SmartEnum.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<PackageReleaseNotes>Updating to net7.</PackageReleaseNotes>
<AssemblyName>Ardalis.SmartEnum</AssemblyName>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetFrameworks>net6.0;net7.0;netstandard2.1</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<ItemGroup>

Expand All @@ -16,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" >
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" >
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<RootNamespace>Ardalis.SmartEnum.Dapper.UnitTests</RootNamespace>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" >
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\SmartEnum.JsonNet\SmartEnum.JsonNet.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" >
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" >
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<LangVersion>8</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<LangVersion>8</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\SmartEnum.SystemTextJson\SmartEnum.SystemTextJson.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" >
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" >
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions test/SmartEnum.UnitTests/SmartEnum.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SmartEnum\SmartEnum.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<LangVersion>7.3</LangVersion>
<LangVersion>8</LangVersion>
<Features>strict</Features>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SmartEnum.Utf8Json\SmartEnum.Utf8Json.csproj" />
<ProjectReference Include="..\..\src\SmartEnum\SmartEnum.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" >
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" >
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" >
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 5 additions & 3 deletions test/SmartFlagEnum.UnitTests/SmartFlagEnum.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="coverlet.msbuild" >
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Loading