Skip to content

Commit

Permalink
.net sdk 升级到 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
UtilCore committed Jan 30, 2024
1 parent 3be3c2e commit 9198fdb
Show file tree
Hide file tree
Showing 100 changed files with 344 additions and 323 deletions.
2 changes: 1 addition & 1 deletion build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FlubuCore" Version="7.0.1" />
<PackageReference Include="FlubuCore" Version="8.0.0" />
</ItemGroup>

</Project>
27 changes: 24 additions & 3 deletions build/BuildScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public class BuildScript : DefaultBuildScript {
/// 忽略测试项目文件列表
/// </summary>
public List<FileFullPath> IgnoreTestProjecs { get; set; }
/// <summary>
/// 忽略打包项目文件列表
/// </summary>
public List<FileFullPath> IgnorePackProjecs { get; set; }

/// <summary>
/// 获取集成测试项目文件列表
Expand All @@ -70,6 +74,13 @@ protected List<FileFullPath> GetIntegrationTestProjecs() {
return IntegrationTestProjecs.Where( t => IgnoreTestProjecs.Exists( p => p.FileName == t.FileName ) == false ).ToList();
}

/// <summary>
/// 获取打包项目文件列表
/// </summary>
protected List<FileFullPath> GetPackProjecs() {
return Projects.Where( t => IgnorePackProjecs.Exists( p => p.FileName == t.FileName ) == false ).ToList();
}

/// <summary>
/// 构建前操作
/// </summary>
Expand All @@ -79,7 +90,9 @@ protected override void BeforeBuildExecution( ITaskContext context ) {
UnitTestProjecs = context.GetFiles( TestDir, "*/*.Tests.csproj" );
IntegrationTestProjecs = context.GetFiles( TestDir, "*/*.Tests.Integration.csproj" );
IgnoreTestProjecs = new List<FileFullPath>();
IgnorePackProjecs = new List<FileFullPath>();
AddIgnoreTestProjecs( context );
AddIgnorePackProjecs( context );
}

/// <summary>
Expand All @@ -88,8 +101,16 @@ protected override void BeforeBuildExecution( ITaskContext context ) {
private void AddIgnoreTestProjecs( ITaskContext context ) {
IgnoreTestProjecs.AddRange( context.GetFiles( TestDir, "*/Util.Images.*.Tests.Integration.csproj" ) );
IgnoreTestProjecs.AddRange( context.GetFiles( TestDir, "*/*.Oracle.Tests.Integration.csproj" ) );
IgnoreTestProjecs.AddRange( context.GetFiles( TestDir, "*/*.Dapper.*.Tests.Integration.csproj" ) );
}
IgnoreTestProjecs.AddRange( context.GetFiles( TestDir, "*/Util.Data.Dapper.PostgreSql.Tests.Integration.csproj" ) );
IgnoreTestProjecs.AddRange( context.GetFiles( TestDir, "*/*.Dapr.Tests.Integration.csproj" ) );
}

/// <summary>
/// 添加忽略打包项目文件列表
/// </summary>
private void AddIgnorePackProjecs( ITaskContext context ) {
IgnorePackProjecs.AddRange( context.GetFiles( SourceDir, "*/*.WebApiClient.csproj" ) );
}

/// <summary>
/// 配置构建目标
Expand Down Expand Up @@ -175,7 +196,7 @@ private ITarget Pack( ITaskContext context, params ITarget[] dependTargets ) {
return context.CreateTarget( "pack" )
.SetDescription( "Create nuget packages." )
.DependsOn( dependTargets )
.ForEach( Projects, ( project, target ) => {
.ForEach( GetPackProjecs(), ( project, target ) => {
target.AddCoreTask( t => t.Pack()
.Project( project )
.IncludeSymbols()
Expand Down
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Import Project="version.props" />
<PropertyGroup>
<NetTargetFramework>net7.0</NetTargetFramework>
<NetTargetFramework>net8.0</NetTargetFramework>
</PropertyGroup>
<PropertyGroup>
<Product>Util Application Framework</Product>
Expand Down
6 changes: 3 additions & 3 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<VersionMajor>7</VersionMajor>
<VersionMinor>1</VersionMinor>
<VersionPatch>131</VersionPatch>
<VersionMajor>8</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Util.Aop.AspectCore/03-Util.Aop.AspectCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ItemGroup>
<PackageReference Include="AspectCore.Extensions.AspectScope" Version="2.4.0" />
<PackageReference Include="AspectCore.Extensions.DependencyInjection" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions src/Util.Core/01-Util.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.8" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Util.Data.Dapper.Core/01-Util.Data.Dapper.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="Dapper" Version="2.1.28" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MySqlConnector" Version="2.2.7" />
<PackageReference Include="MySqlConnector" Version="2.3.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.120" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.130" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="7.0.6" />
<PackageReference Include="Npgsql" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-beta.2" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 9 additions & 2 deletions src/Util.Data.EntityFrameworkCore.MySql/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ private static IAppBuilder AddMySqlUnitOfWork<TService, TImplementation>( this I
void Action( DbContextOptionsBuilder options ) {
setupAction?.Invoke( options );
if ( connectionString.IsEmpty() == false ) {
options.UseMySql( connectionString, ServerVersion.AutoDetect( connectionString ), mySqlSetupAction );
options.UseMySql( connectionString, ServerVersion.AutoDetect( connectionString ),
optionsBuilder => {
optionsBuilder.EnableRetryOnFailure();
mySqlSetupAction?.Invoke( optionsBuilder );
} );
return;
}
if ( connection != null ) {
options.UseMySql( connection, ServerVersion.AutoDetect( (MySqlConnection)connection ), mySqlSetupAction );
options.UseMySql( connection, ServerVersion.AutoDetect( (MySqlConnection)connection ), optionsBuilder => {
optionsBuilder.EnableRetryOnFailure();
mySqlSetupAction?.Invoke( optionsBuilder );
} );
}
}
services.AddDbContext<TImplementation>( Action );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.12" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="8.21.121" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="MediatR" Version="12.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 10 additions & 3 deletions src/Util.FileStorage/Local/LocalFileStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected virtual async Task<LocalStoreOptions> GetConfig() {
/// 处理文件名
/// </summary>
protected virtual ProcessedName ProcessFileName( FileStorageArgs args ) {
if( args.FileName.IsEmpty() )
if ( args.FileName.IsEmpty() )
throw new ArgumentNullException( nameof( args.FileName ) );
var processor = _fileNameProcessorFactory.CreateProcessor( args.FileNamePolicy );
return processor.Process( args.FileName );
Expand All @@ -127,7 +127,14 @@ protected virtual ProcessedName ProcessFileName( FileStorageArgs args ) {
/// </summary>
protected virtual async Task<string> GetPhysicalPath( ProcessedName fileName ) {
var config = await GetConfig();
return Path.Combine( Util.Helpers.Web.Environment.WebRootPath, config.RootPath, fileName.Name );
return Path.Combine( GetRootPath(), config.RootPath, fileName.Name );
}

/// <summary>
/// 获取根路径
/// </summary>
protected virtual string GetRootPath() {
return Util.Helpers.Web.Environment == null ? string.Empty : Util.Helpers.Web.Environment.WebRootPath;
}

#endregion
Expand Down Expand Up @@ -172,7 +179,7 @@ protected virtual async Task<string> GetPhysicalPath( ProcessedName fileName ) {
stream.CheckNull( nameof( stream ) );
var config = await GetConfig();
var filePath = Path.Combine( config.RootPath, fileName.Name );
var physicalPath = Path.Combine( Util.Helpers.Web.Environment.WebRootPath, filePath );
var physicalPath = Path.Combine( GetRootPath(), filePath );
await Util.Helpers.File.WriteAsync( physicalPath, stream, cancellationToken );
return new FileResult( filePath, stream.Length, fileName.OriginalName );
}
Expand Down
4 changes: 2 additions & 2 deletions src/Util.Http/07-Util.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Util.Images.ImageSharp/01-Util.Images.ImageSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Util.Localization/09-Util.Localization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Util.Logging.Serilog/02-Util.Logging.Serilog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="5.2.3" />
<PackageReference Include="Serilog.Sinks.Seq" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Util.Logging/01-Util.Logging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="7.1.0" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.13" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Polly" Version="8.1.0" />
<PackageReference Include="Polly" Version="8.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 9198fdb

Please sign in to comment.