Skip to content
Open
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
30 changes: 13 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ on:
jobs:
build:
name: Build
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
8.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,16 +29,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-2019 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.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 @@ -49,7 +47,7 @@ jobs:

sonar-ci:
name: SonarCloud
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -58,9 +56,8 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.0.x
- uses: actions/setup-java@v4
with:
java-version: '21' # The JDK version to make available on the path.
Expand All @@ -69,14 +66,14 @@ jobs:
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
Expand Down Expand Up @@ -107,9 +104,8 @@ jobs:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.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 Down Expand Up @@ -137,7 +133,7 @@ jobs:
fail-on-alert: false
alert-comment-cc-users: '@zjklee'
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Benchmark
path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ on:
jobs:
build:
name: Build
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.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,16 +29,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-2019 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.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 @@ -49,7 +47,7 @@ jobs:

sonar-pr:
name: SonarCloud
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -58,9 +56,8 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.0.x
- uses: actions/setup-java@v4
with:
java-version: '21' # The JDK version to make available on the path.
Expand All @@ -69,14 +66,14 @@ jobs:
working-directory: ./source
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
Expand Down Expand Up @@ -107,9 +104,8 @@ jobs:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.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 Down Expand Up @@ -138,7 +134,7 @@ jobs:
alert-comment-cc-users: '@zjklee'

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Benchmark
path: source/Handlebars.Benchmark/BenchmarkDotNet.Artifacts/results/
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
publish:
name: Publish
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

Expand All @@ -22,9 +22,8 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
6.0.x
8.0.x

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

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<RootNamespace>HandlebarsNet.Benchmark</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion source/Handlebars.Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static class Program
public static void Main(string[] args)
{
var job = Job.MediumRun
.WithToolchain(CsProjCoreToolchain.NetCoreApp31)
.WithToolchain(CsProjCoreToolchain.NetCoreApp80)
.WithLaunchCount(1);

var manualConfig = DefaultConfig.Instance
Expand Down
10 changes: 5 additions & 5 deletions source/Handlebars.Test/Handlebars.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">$(TargetFrameworks);net452;net46;net461;net472</TargetFrameworks>
<TargetFrameworks>net6;net8</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">$(TargetFrameworks);net452;net462;net472;net481</TargetFrameworks>
<ProjectGuid>6BA232A6-8C4D-4C7D-BD75-1844FE9774AF</ProjectGuid>
<RootNamespace>HandlebarsDotNet.Test</RootNamespace>
<IsPackable>false</IsPackable>
Expand All @@ -22,23 +22,23 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="1.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)'=='net46' or '$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472' or '$(TargetFramework)'=='net452'">
<ItemGroup Condition="'$(TargetFramework)'=='net452' or '$(TargetFramework)'=='net462' or '$(TargetFramework)'=='net472' or '$(TargetFramework)'=='net481'">
<PackageReference Include="CsQuery" Version="1.3.4" />
<PackageReference Include="Microsoft.AspNet.WebPages" Version="3.2.3" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)'!='net46' and '$(TargetFramework)'!='net461' and '$(TargetFramework)'!='net472' and '$(TargetFramework)'!='net452'">
<ItemGroup Condition="'$(TargetFramework)'!='net452' and '$(TargetFramework)'!='net462' and '$(TargetFramework)'!='net472' and '$(TargetFramework)'!='net481'">
<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
19 changes: 4 additions & 15 deletions 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;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6;net8</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net451</TargetFrameworks>
<Version>2.0.0</Version>
<RootNamespace>HandlebarsDotNet</RootNamespace>
Expand Down Expand Up @@ -36,27 +36,16 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net451'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.3'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net451'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0' or '$(TargetFramework)'=='netstandard2.1'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ExpressionShortcuts" Version="1.0.4.39" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
4 changes: 0 additions & 4 deletions source/Handlebars/IO/EncodedTextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ public void Write<T>(T value)
private void WriteFormatted<T>(T value)
{
var type = typeof(T);
#if NETSTANDARD1_3
if (type.GetTypeInfo().IsClass) type = value.GetType();
#else
if (type.IsClass) type = value.GetType();
#endif

if (!_formatterProvider.TryCreateFormatter(type, out var formatter))
Throw.CannotResolveFormatter(type);
Expand Down
Loading