Skip to content

Commit 837fc18

Browse files
authored
Merge pull request #578 from thompson-tomo/chore/#573_AddAdditionalTFM
2 parents bed0c0e + 3961cf7 commit 837fc18

File tree

9 files changed

+102
-144
lines changed

9 files changed

+102
-144
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches: [ master ]
6-
6+
77
jobs:
88
build:
99
name: Build
@@ -30,14 +30,13 @@ jobs:
3030
os: [ macos-latest, ubuntu-latest, windows-2019 ]
3131
steps:
3232
- uses: actions/checkout@master
33-
- name: Setup dotnet 2.1
34-
uses: actions/setup-dotnet@v1
35-
with:
36-
dotnet-version: 2.1.x
37-
- name: Setup dotnet 3.1
33+
- name: Setup dotnet
3834
uses: actions/setup-dotnet@v1
3935
with:
40-
dotnet-version: 3.1.x
36+
dotnet-version: |
37+
2.1.x
38+
3.1.x
39+
6.0.x
4140
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
4241
working-directory: ./source
4342
run: dotnet clean -c Release && dotnet nuget locals all --clear
@@ -52,14 +51,13 @@ jobs:
5251
- uses: actions/checkout@v2
5352
with:
5453
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
55-
- name: Setup dotnet 2.1
56-
uses: actions/setup-dotnet@v1
57-
with:
58-
dotnet-version: 2.1.x
59-
- name: Setup dotnet 3.1
54+
- name: Setup dotnet
6055
uses: actions/setup-dotnet@v1
6156
with:
62-
dotnet-version: 3.1.x
57+
dotnet-version: |
58+
2.1.x
59+
3.1.x
60+
6.0.x
6361
- uses: actions/setup-java@v4
6462
with:
6563
java-version: '21' # The JDK version to make available on the path.
@@ -97,15 +95,18 @@ jobs:
9795
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Handlebars-Net_Handlebars.Net" /o:"handlebars-net" /d:sonar.login="${{ env.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/*.opencover.xml" /d:sonar.cs.vstest.reportsPaths="**/*.trx" /d:sonar.coverage.exclusions="**/*.md;source/Handlebars.Benchmark/**/*.*" /d:sonar.cpd.exclusions="source/Handlebars/Iterators/**/*.*"
9896
dotnet build source/Handlebars.sln -c Release
9997
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ env.SONAR_TOKEN }}"
100-
98+
10199
benchmark:
102100
name: Run Benchmark.Net
103101
runs-on: ubuntu-latest
104102
steps:
105103
- uses: actions/checkout@v2
106104
- uses: actions/setup-dotnet@v1
107105
with:
108-
dotnet-version: 3.1.x
106+
dotnet-version: |
107+
2.1.x
108+
3.1.x
109+
6.0.x
109110
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
110111
working-directory: ./source
111112
run: dotnet clean -c Release && dotnet nuget locals all --clear
@@ -136,8 +137,8 @@ jobs:
136137
uses: actions/upload-artifact@v2
137138
with:
138139
name: Benchmark
139-
path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/
140-
140+
path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/
141+
141142
update_release_draft:
142143
name: Release Drafter
143144
runs-on: ubuntu-latest

.github/workflows/pull_request.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ on:
66

77
jobs:
88
build:
9-
name: Build
9+
name: Build
1010
runs-on: windows-2019
1111
steps:
1212
- uses: actions/checkout@master
1313
- name: Setup dotnet
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: 3.1.x
16+
dotnet-version: |
17+
2.1.x
18+
3.1.x
19+
6.0.x
1720
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
1821
working-directory: ./source
1922
run: dotnet clean -c Release && dotnet nuget locals all --clear
2023
- name: Build
2124
working-directory: ./source
2225
run: dotnet build -c Release
23-
26+
2427
test:
2528
name: Tests on ${{ matrix.os }}
2629
needs: [ build ]
@@ -30,36 +33,34 @@ jobs:
3033
os: [ macos-latest, ubuntu-latest, windows-2019 ]
3134
steps:
3235
- uses: actions/checkout@master
33-
- name: Setup dotnet 2.1
34-
uses: actions/setup-dotnet@v1
35-
with:
36-
dotnet-version: 2.1.x
37-
- name: Setup dotnet 3.1
36+
- name: Setup dotnet
3837
uses: actions/setup-dotnet@v1
3938
with:
40-
dotnet-version: 3.1.x
39+
dotnet-version: |
40+
2.1.x
41+
3.1.x
42+
6.0.x
4143
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
4244
working-directory: ./source
4345
run: dotnet clean -c Release && dotnet nuget locals all --clear
4446
- name: Test
4547
working-directory: ./source
4648
run: dotnet test --logger:trx --logger:GitHubActions
47-
49+
4850
sonar-pr:
4951
name: SonarCloud
5052
runs-on: windows-2019
5153
steps:
52-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v2
5355
with:
5456
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
55-
- name: Setup dotnet 2.1
56-
uses: actions/setup-dotnet@v1
57-
with:
58-
dotnet-version: 2.1.x
59-
- name: Setup dotnet 3.1
57+
- name: Setup dotnet
6058
uses: actions/setup-dotnet@v1
6159
with:
62-
dotnet-version: 3.1.x
60+
dotnet-version: |
61+
2.1.x
62+
3.1.x
63+
6.0.x
6364
- uses: actions/setup-java@v4
6465
with:
6566
java-version: '21' # The JDK version to make available on the path.
@@ -105,7 +106,10 @@ jobs:
105106
- uses: actions/checkout@v2
106107
- uses: actions/setup-dotnet@v1
107108
with:
108-
dotnet-version: 3.1.x
109+
dotnet-version: |
110+
2.1.x
111+
3.1.x
112+
6.0.x
109113
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
110114
working-directory: ./source
111115
run: dotnet clean -c Release && dotnet nuget locals all --clear
@@ -132,7 +136,7 @@ jobs:
132136
comment-on-alert: true
133137
fail-on-alert: false
134138
alert-comment-cc-users: '@zjklee'
135-
139+
136140
- name: Upload Artifacts
137141
uses: actions/upload-artifact@v2
138142
with:

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ jobs:
2121
- name: Setup dotnet
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 3.1.x
24+
dotnet-version: |
25+
2.1.x
26+
3.1.x
27+
6.0.x
2528
2629
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
2730
working-directory: ./source

source/Handlebars.Test/DynamicTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class EnvGenerator : IEnumerable<object[]>
2222

2323
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
2424
}
25-
25+
2626
[Fact]
2727
public void DynamicObjectBasicTest()
2828
{
@@ -36,7 +36,7 @@ public void DynamicObjectBasicTest()
3636

3737
Assert.Equal("Foo: 1\nBar: hello world", output);
3838
}
39-
39+
4040
[Fact]
4141
public void DynamicObjectBasicIterationTest()
4242
{
@@ -106,7 +106,7 @@ public void JsonTestArrays(IHandlebars handlebars){
106106

107107
Assert.Equal("Key1Val1Key2Val2", output);
108108
}
109-
109+
110110
[Theory]
111111
[ClassData(typeof(EnvGenerator))]
112112
public void JsonTestArrayCount(IHandlebars handlebars)
@@ -121,7 +121,7 @@ public void JsonTestArrayCount(IHandlebars handlebars)
121121

122122
Assert.Equal("2", output);
123123
}
124-
124+
125125
[Theory]
126126
[ClassData(typeof(EnvGenerator))]
127127
public void JsonTestObjects(IHandlebars handlebars){
@@ -150,7 +150,7 @@ public void JObjectTest(IHandlebars handlebars) {
150150

151151
Assert.Equal("", output);
152152
}
153-
153+
154154
[Theory]
155155
[ClassData(typeof(EnvGenerator))]
156156
public void WithParentIndexJsonNet(IHandlebars handlebars)
@@ -174,7 +174,7 @@ public void WithParentIndexJsonNet(IHandlebars handlebars)
174174
{{/each}}
175175
{{/each}}
176176
{{/each}}";
177-
177+
178178
var template = handlebars.Compile( source );
179179
var data = new
180180
{
@@ -281,13 +281,13 @@ public void WithParentIndexJsonNet(IHandlebars handlebars)
281281
index=[1:1:1]
282282
first=[False:False:False]
283283
last=[True:True:True]";
284-
284+
285285
Func<string, string> makeFlat = text => text.Replace( " ", "" ).Replace( "\n", "" ).Replace( "\r", "" );
286286

287287
Assert.Equal( makeFlat( expected ), makeFlat( result ) );
288288
}
289289

290-
#if !netstandard
290+
#if NET452 || NET46 || NET461 || NET472
291291

292292
[Fact]
293293
public void SystemJsonTestArrays()

source/Handlebars.Test/Handlebars.Test.csproj

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">$(TargetFrameworks);net452;net46;net461;net472</TargetFrameworks>
66
<ProjectGuid>6BA232A6-8C4D-4C7D-BD75-1844FE9774AF</ProjectGuid>
77
<RootNamespace>HandlebarsDotNet.Test</RootNamespace>
88
<IsPackable>false</IsPackable>
99
<SignAssembly>false</SignAssembly>
1010
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1111
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
12-
</PropertyGroup>
13-
14-
<PropertyGroup>
1512
<NoWarn>0618;1701</NoWarn>
1613
</PropertyGroup>
1714

18-
<PropertyGroup Condition="'$(TargetFramework)'=='net472'">
19-
<DefineConstants>$(DefineConstants);netFramework</DefineConstants>
20-
</PropertyGroup>
21-
<PropertyGroup Condition="'$(TargetFramework)'=='net461'">
22-
<DefineConstants>$(DefineConstants);netFramework</DefineConstants>
23-
</PropertyGroup>
24-
<PropertyGroup Condition="'$(TargetFramework)'=='net46'">
25-
<DefineConstants>$(DefineConstants);netFramework</DefineConstants>
26-
</PropertyGroup>
27-
<PropertyGroup Condition="'$(TargetFramework)'=='net452'">
28-
<DefineConstants>$(DefineConstants);netFramework</DefineConstants>
29-
</PropertyGroup>
30-
31-
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp2.1'">
32-
<DefineConstants>$(DefineConstants);netcoreapp;netstandard</DefineConstants>
33-
</PropertyGroup>
34-
35-
<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
36-
<DefineConstants>$(DefineConstants);netcoreapp;netstandard</DefineConstants>
37-
</PropertyGroup>
38-
3915
<ItemGroup>
4016
<ProjectReference Include="..\Handlebars\Handlebars.csproj" />
4117
</ItemGroup>
@@ -52,26 +28,26 @@
5228
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
5329
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
5430
</ItemGroup>
55-
31+
5632

5733
<ItemGroup Condition="'$(TargetFramework)'=='net46' or '$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472' or '$(TargetFramework)'=='net452'">
5834
<PackageReference Include="CsQuery" Version="1.3.4" />
5935
<PackageReference Include="Microsoft.AspNet.WebPages" Version="3.2.3" />
6036
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
6137
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
6238
</ItemGroup>
63-
6439

65-
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1' or '$(TargetFramework)'=='netcoreapp2.1'">
40+
41+
<ItemGroup Condition="'$(TargetFramework)'!='net46' and '$(TargetFramework)'!='net461' and '$(TargetFramework)'!='net472' and '$(TargetFramework)'!='net452'">
6642
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
6743
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
6844
<PackageReference Include="CsQuery.NetStandard" Version="1.3.6.1" />
6945
</ItemGroup>
70-
46+
7147
<ItemGroup>
7248
<Content Include="ViewEngine\**\*.hbs" CopyToOutputDirectory="PreserveNewest" />
7349
</ItemGroup>
74-
50+
7551
<ItemGroup>
7652
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
7753
</ItemGroup>

0 commit comments

Comments
 (0)