Skip to content

Commit

Permalink
Set targets and versions to Net Core 3.1, Net 5 and Net 6
Browse files Browse the repository at this point in the history
Application version 3.2.0 (#54)
Set targets and versions to Net Core 3.1, Net 5 and Net 6
Add Directory.Build.targets with version of nugets
Modify workflows to support Net 5 and Net 6
Clean ".csproj"s
  • Loading branch information
Sergio1192 authored Mar 25, 2022
1 parent c2c6544 commit ac68313
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 46 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET SDK 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.200
- name: Setup .NET SDK 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Setup .NET Core SDK 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.417
- name: Build .NET 3.1
run: dotnet build -c $BUILD_CONFIG
run: dotnet build -c $BUILD_CONFIG --framework netcoreapp3.1
- name: Build .NET 5.0
run: dotnet build -c $BUILD_CONFIG --framework net5.0
- name: Build .NET 6.0
run: dotnet build -c $BUILD_CONFIG --framework net6.0
- name: Test
run: dotnet test -c $BUILD_CONFIG --no-build
8 changes: 8 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET SDK 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.200
- name: Setup .NET SDK 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Setup .NET Core SDK 3.1
uses: actions/setup-dotnet@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions Acheve.TestHost.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{97C5D07D-D623-497A-9DA5-2B3376A4F0DC}"
ProjectSection(SolutionItems) = preProject
build\dependencies.props = build\dependencies.props
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
global.json = global.json
EndProjectSection
EndProject
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
<Import Project="build/dependencies.props" />

<PropertyGroup Label="Package information">
<Version>3.1.0</Version>
<Version>3.2.0</Version>

<PackageLicenseUrl>https://github.com/Xabaril/Acheve.TestHost/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>http://github.com/xabaril/Acheve.TestHost</PackageProjectUrl>
<RepositoryUrl>http://github.com/xabaril/Acheve.TestHost</RepositoryUrl>
<Authors>Xabaril Contributors</Authors>
<Company>Xabaril</Company>
<Description>Achve.TestHost is a nuget package to improve TestServer experiences.
For more information see http://github.com/Xabaril/Acheve.TestHost</Description>
<Tags>TestHost;TestServer</Tags>
<PackageTags>TestHost;TestServer</PackageTags>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
34 changes: 34 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project>
<ItemGroup Label="General Dependencies">
<PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="$(NetCoreVersion3)" />
<PackageReference Update="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(NetCoreVersion3)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="$(NetCoreVersion5)" />
<PackageReference Update="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(NetCoreVersion5)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="$(NetCoreVersion6)" />
<PackageReference Update="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(NetCoreVersion6)" />
</ItemGroup>

<ItemGroup Label="Testing Dependencies">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Update="FluentAssertions" Version="6.5.1" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="coverlet.collector" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
18 changes: 6 additions & 12 deletions build/dependencies.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<Project>
<PropertyGroup Label="SDK Versions">
<NetCoreTargetVersion>netcoreapp3.1</NetCoreTargetVersion>
<MicrosoftNETTestSdkPackageVersion>17.1.0</MicrosoftNETTestSdkPackageVersion>
<NetCoreTargetVersion>netcoreapp3.1;net5.0;net6.0</NetCoreTargetVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Label="Package Versions">
<MicrosoftAspNetCoreTestHostVersion>3.1.23</MicrosoftAspNetCoreTestHostVersion>
<JwtBearerVersion>3.1.23</JwtBearerVersion>
<FluentAssertionsVersion>6.5.1</FluentAssertionsVersion>
<NewtonsoftJson>13.0.1</NewtonsoftJson>
<MicrosoftSourceLinkGithub>1.1.1</MicrosoftSourceLinkGithub>
</PropertyGroup>
<NetCoreVersion3>3.1.23</NetCoreVersion3>
<NetCoreVersion5>5.0.15</NetCoreVersion5>
<NetCoreVersion6>6.0.3</NetCoreVersion6>

<PropertyGroup Label="Testing Dependencies">
<DotnetXUnitPackageVersion>2.4.1</DotnetXUnitPackageVersion>
<DotnetXUnitRunnerPackageVersion>2.4.3</DotnetXUnitRunnerPackageVersion>
<MicrosoftSourceLinkGithub>1.1.1</MicrosoftSourceLinkGithub>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"projects": [ "src", "test", "samples" ],
"sdk": {
"version": "3.1.300",
"version": "6.0.100",
"rollForward": "latestMajor"
}
}
2 changes: 1 addition & 1 deletion samples/Sample.Api/Sample.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<TargetFrameworks>$(NetCoreTargetVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions samples/Sample.Host/Sample.Host.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<TargetFrameworks>$(NetCoreTargetVersion)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(JwtBearerVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions samples/Sample.IntegrationTests/Sample.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<TargetFrameworks>$(NetCoreTargetVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Acheve.TestHost\Acheve.TestHost.csproj" />
<ProjectReference Include="..\Sample.Api\Sample.Api.csproj" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="coverlet.collector" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(DotnetXUnitRunnerPackageVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(MicrosoftAspNetCoreTestHostVersion)" />
<PackageReference Include="xunit" Version="$(DotnetXUnitPackageVersion)" />
<ProjectReference Include="..\..\src\Acheve.TestHost\Acheve.TestHost.csproj" />
<ProjectReference Include="..\Sample.Api\Sample.Api.csproj" />
</ItemGroup>

</Project>
15 changes: 3 additions & 12 deletions src/Acheve.TestHost/Acheve.TestHost.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>

<Version>$(Version)</Version>
<PackageLicenseUrl>$(PackageLicenseUrl)</PackageLicenseUrl>
<PackageProjectUrl>$(PackageProjectUrl)</PackageProjectUrl>
<RepositoryUrl>$(RepositoryUrl)</RepositoryUrl>
<Authors>$(Authors)</Authors>
<Company>$(Company)</Company>
<Description>$(Description)</Description>
<PackageTags>$(Tags)</PackageTags>
<TargetFrameworks>$(NetCoreTargetVersion)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,8 +14,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(MicrosoftAspNetCoreTestHostVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJson)" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

</Project>
13 changes: 6 additions & 7 deletions tests/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>

<TargetFrameworks>$(NetCoreTargetVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(MicrosoftAspNetCoreTestHostVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="xunit" Version="$(DotnetXUnitPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(DotnetXUnitRunnerPackageVersion)" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="coverlet.collector" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ac68313

Please sign in to comment.