Skip to content

Commit

Permalink
feat: remove netstandard2.1/net6.0/net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Dec 10, 2024
1 parent 20727c7 commit 98af58a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Import Project="./build/version.props" />
<PropertyGroup>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>WeihanLi</Authors>
Expand Down
5 changes: 2 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<PropertyGroup>
<!-- Enable central package management -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0'">6.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net7.0'">7.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'netstandard2.0'">8.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0.0</ExtensionPackageVersion>
</PropertyGroup>
Expand Down Expand Up @@ -39,6 +38,6 @@
<PackageVersion Include="Dapper" Version="2.1.44" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="PolySharp" Version="1.14.1" />
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"rollForward": "latestMajor",
"version": "8.0.100",
"version": "9.0.101",
"allowPrerelease": true
}
}
3 changes: 2 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<PackageIcon>icon.jpg</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LangVersion>Preview</LangVersion>
<LangVersion>preview</LangVersion>
<NoWarn>$(NoWarn);CS9216;</NoWarn>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Object" Alias="Lock" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" />
Expand Down
2 changes: 1 addition & 1 deletion src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public bool IsEnabled(LogLevel logLevel)
return _logger.IsEnabled(ConvertLevel(logLevel));
}

public IDisposable BeginScope<TState>(TState state)
public IDisposable? BeginScope<TState>(TState state) where TState : notnull
{
return _provider.BeginScope(state);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net9.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<PackageProjectUrl>https://github.com/WeihanLi/WeihanLi.Common/tree/dev/src/WeihanLi.Common.Logging.Serilog</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>$(PackageTags);logging;serilog</PackageTags>
Expand Down
4 changes: 2 additions & 2 deletions src/WeihanLi.Common/Extensions/ProcessExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ public static CommandResult GetResult(this ProcessStartInfo psi)
public static async Task<CommandResult> GetResultAsync(this ProcessStartInfo psi, CancellationToken cancellationToken = default)
{
var stdOutStringBuilder = new StringBuilder();
#if NETSTANDARD2_1 || NET6_0_OR_GREATER
#if NET
await
#endif
using var stdOut = new StringWriter(stdOutStringBuilder);
var stdErrStringBuilder = new StringBuilder();
#if NETSTANDARD2_1 || NET6_0_OR_GREATER
#if NET
await
#endif
using var stdErr = new StringWriter(stdErrStringBuilder);
Expand Down
4 changes: 1 addition & 3 deletions src/WeihanLi.Common/WeihanLi.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<PackageId>WeihanLi.Common</PackageId>
<Title>WeihanLi.Common</Title>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<Description>common libarary,extensions helpers and useful utilities</Description>
<PackageTags>$(PackageTags);common;utility;lib;libarary;extensions;helpers</PackageTags>
<PackageSummary>common libarary,extensions helpers and useful utilities</PackageSummary>
Expand All @@ -18,8 +18,6 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Reflection.Emit" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="Microsoft.CSharp" PrivateAssets="All" />
</ItemGroup>
Expand Down

0 comments on commit 98af58a

Please sign in to comment.