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

Add net5 and net6 as TargetFrameworks #479

Closed
wants to merge 3 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
17 changes: 0 additions & 17 deletions .github/auto-merge.yml

This file was deleted.

45 changes: 27 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -30,14 +34,14 @@ jobs:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@master
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -52,14 +56,14 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- uses: actions/setup-java@v1
with:
java-version: '13' # The JDK version to make available on the path.
Expand Down Expand Up @@ -102,15 +106,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: Run benchmark
working-directory: ./source/Handlebars.Benchmark
run: dotnet run -c Release --exporters json --filter '*' -m --join
run: dotnet run -c Release -f net6 --exporters json --filter '*' -m --join
- name: Get benchmark file name
id: benchmarkfilename
working-directory: ./source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results
Expand Down
40 changes: 24 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -30,14 +33,14 @@ jobs:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@master
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -52,14 +55,14 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- uses: actions/setup-java@v1
with:
java-version: '13' # The JDK version to make available on the path.
Expand Down Expand Up @@ -102,15 +105,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: Run benchmark
working-directory: ./source/Handlebars.Benchmark
run: dotnet run -c Release --exporters json --filter '*' -m --join
run: dotnet run -c Release -f net6 --exporters json --filter '*' -m --join
- name: Get benchmark file name
working-directory: ./source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results
id: benchmarkfilename
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x

- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
working-directory: ./source
Expand Down
4 changes: 2 additions & 2 deletions source/Handlebars.Benchmark/Handlebars.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5;net6</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<RootNamespace>HandlebarsNet.Benchmark</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

Expand Down
12 changes: 10 additions & 2 deletions source/Handlebars.Test/Handlebars.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5;net6</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">$(TargetFrameworks);net452;net46;net461;net472</TargetFrameworks>
<ProjectGuid>6BA232A6-8C4D-4C7D-BD75-1844FE9774AF</ProjectGuid>
<RootNamespace>HandlebarsDotNet.Test</RootNamespace>
Expand Down Expand Up @@ -36,6 +36,14 @@
<DefineConstants>$(DefineConstants);netcoreapp;netstandard</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net5'">
<DefineConstants>$(DefineConstants);netcoreapp;netstandard;net</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6'">
<DefineConstants>$(DefineConstants);netcoreapp;netstandard;net</DefineConstants>
</PropertyGroup>

Comment on lines +39 to +46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be checked if this is really needed.

<ItemGroup>
<ProjectReference Include="..\Handlebars\Handlebars.csproj" />
</ItemGroup>
Expand All @@ -62,7 +70,7 @@
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1' or '$(TargetFramework)'=='netcoreapp2.1'">
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1' or '$(TargetFramework)'=='netcoreapp2.1' or '$(TargetFramework)'=='net5' or '$(TargetFramework)'=='net6'">
Comment on lines -65 to +73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition should be simplified to improve maintenance going forward.

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
<PackageReference Include="CsQuery.NetStandard" Version="1.3.6.1" />
Expand Down
17 changes: 16 additions & 1 deletion source/Handlebars/Handlebars.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Handlebars</AssemblyName>
<ProjectGuid>9822C7B8-7E51-42BC-9A49-72A10491B202</ProjectGuid>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1;net5;net6</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net451;net452;net46</TargetFrameworks>
<Version>2.0.0</Version>
<RootNamespace>HandlebarsDotNet</RootNamespace>
Expand Down Expand Up @@ -66,9 +66,24 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net5'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

Comment on lines +69 to +76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Microsoft.CSharp is a polyfill package hence this dependency should be able to be removed on the newer frameworks.

<ItemGroup>
<PackageReference Include="ExpressionShortcuts" Version="1.0.4.39" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(ContinuousIntegrationBuild)' != 'true'">
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.33.0.40503">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
Comment on lines +80 to +86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be bundled in existing item group


<ItemGroup Condition="'$(ContinuousIntegrationBuild)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
Expand Down