Skip to content

Commit

Permalink
#49 cross-target all projects to netcoreapp3.1 and net5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Sep 21, 2020
1 parent aa7a41a commit 291777a
Show file tree
Hide file tree
Showing 47 changed files with 242 additions and 128 deletions.
15 changes: 12 additions & 3 deletions src/Sitko.Core.App.Web/Sitko.Core.App.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -22,11 +22,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.8" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0-rc.1.20451.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0-rc.1.20451.17" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-rc.1.20451.17" />
</ItemGroup>

<ItemGroup>
Expand Down
49 changes: 31 additions & 18 deletions src/Sitko.Core.App/Sitko.Core.App.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand All @@ -20,26 +20,39 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Flurl.Http" Version="2.4.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.8" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Serilog.Exceptions" Version="5.6.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
<PackageReference Include="Scrutor" Version="3.2.2" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Flurl.Http" Version="2.4.2"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Serilog.Exceptions" Version="5.6.0"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1"/>
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1"/>
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0"/>
<PackageReference Include="Scrutor" Version="3.2.2"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.8"/>
<PackageReference Include="System.Text.Json" Version="4.7.2"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.0-rc.1.20451.17"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="System.Text.Json" Version="5.0.0-rc.1.20451.14"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Pack="true" PackagePath="buildTransitive" Include="Build\**\*.xml; Build\**\*.props; Build\**\*.targets;" />
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md"/>
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\"/>
<None Pack="true" PackagePath="buildTransitive" Include="Build\**\*.xml; Build\**\*.props; Build\**\*.targets;"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Sitko.Core.Auth.Basic/Sitko.Core.Auth.Basic.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand All @@ -17,20 +17,29 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.OpenIdConnectServer" Version="3.1.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.8" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="AspNetCore.HealthChecks.OpenIdConnectServer" Version="3.1.1"/>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.8"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.8"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="5.0.0-rc.1.20451.17"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0-rc.1.20451.17"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sitko.Core.Auth\Sitko.Core.Auth.csproj" />
<ProjectReference Include="..\Sitko.Core.Auth\Sitko.Core.Auth.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md"/>
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Sitko.Core.Auth/Sitko.Core.Auth.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Core.Automapper/Sitko.Core.Automapper.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand Down
23 changes: 16 additions & 7 deletions src/Sitko.Core.Caching/Sitko.Core.Caching.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand All @@ -17,17 +17,26 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<NoWarn>8600,8601,8603,8605,8618,8625,8629</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.8"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0-rc.1.20451.14"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0-rc.1.20451.14"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md"/>
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
18 changes: 10 additions & 8 deletions src/Sitko.Core.Consul.Web/ConsulWebModule.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Consul;
using Microsoft.Extensions.Configuration;
Expand All @@ -10,23 +9,26 @@

namespace Sitko.Core.Consul.Web
{
public class ConsulWebModule : BaseApplicationModule<ConsulWebModuleConfig>
public class ConsulWebModule : ConsulModule<ConsulWebModuleConfig>
{
public ConsulWebModule(ConsulWebModuleConfig config, Application application) : base(config, application)
{
}

public override List<Type> GetRequiredModules()
{
return new List<Type> {typeof(ConsulModule)};
}

public override void ConfigureServices(IServiceCollection services, IConfiguration configuration,
IHostEnvironment environment)
{
base.ConfigureServices(services, configuration, environment);
services.AddSingleton<ConsulWebClient>();
services.AddHealthChecks().AddCheck<ConsulWebHealthCheck>("Consul registration");
services.AddHealthChecks()
.AddCheck<ConsulWebHealthCheck>("Consul registration")
.AddConsul(options =>
{
var uri = new Uri(Config.ConsulUri);
options.HostName = uri.Host;
options.Port = uri.Port;
options.RequireHttps = false;
});
}

public override Task ApplicationStarted(IConfiguration configuration, IHostEnvironment environment,
Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Sitko.Core.Consul.Web
{
public class ConsulWebModuleConfig
public class ConsulWebModuleConfig : ConsulModuleConfig
{
public string? IpAddress { get; set; }
public Uri? ServiceUri { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion src/Sitko.Core.Consul.Web/Sitko.Core.Consul.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -24,6 +24,7 @@
<ItemGroup>
<ProjectReference Include="..\Sitko.Core.App.Web\Sitko.Core.App.Web.csproj"/>
<ProjectReference Include="..\Sitko.Core.Consul\Sitko.Core.Consul.csproj"/>
<PackageReference Include="AspNetCore.HealthChecks.Consul" Version="3.1.1"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
Expand Down
16 changes: 7 additions & 9 deletions src/Sitko.Core.Consul/ConsulModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@

namespace Sitko.Core.Consul
{
public class ConsulModule : BaseApplicationModule<ConsulModuleConfig>
public interface IConsulModule
{
public ConsulModule(ConsulModuleConfig config, Application application) : base(config,
}

public class ConsulModule<TConfig> : BaseApplicationModule<TConfig>, IConsulModule
where TConfig : ConsulModuleConfig, new()
{
public ConsulModule(TConfig config, Application application) : base(config,
application)
{
}
Expand All @@ -23,13 +28,6 @@ public override void ConfigureServices(IServiceCollection services, IConfigurati
var options = p.GetRequiredService<ConsulModuleConfig>();
return new ConsulClient(config => { config.Address = new Uri(options.ConsulUri); });
});
services.AddHealthChecks().AddConsul(options =>
{
var uri = new Uri(Config.ConsulUri);
options.HostName = uri.Host;
options.Port = uri.Port;
options.RequireHttps = false;
});
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/Sitko.Core.Consul/Sitko.Core.Consul.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand All @@ -23,9 +23,8 @@
<ItemGroup>
<ProjectReference Include="..\Sitko.Core.App\Sitko.Core.App.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Consul" Version="3.1.1"/>
<!-- https://github.com/SonicGD/consuldotnet cause original lib is dead Wait for https://github.com/G-Research/consuldotnet/pull/22 -->
<PackageReference Include="Consul.GRPC" Version="0.7.2.6"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
Expand Down
22 changes: 15 additions & 7 deletions src/Sitko.Core.Db.InMemory/Sitko.Core.Db.InMemory.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!--<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>-->
Expand All @@ -17,18 +17,26 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.8" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.8"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0-rc.1.20451.13"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sitko.Core.Db\Sitko.Core.Db.csproj" />
<ProjectReference Include="..\Sitko.Core.Db\Sitko.Core.Db.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="LICENSE.md"/>
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
Loading

0 comments on commit 291777a

Please sign in to comment.