Skip to content

Commit

Permalink
Update .NET Core 9.0 (#718)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Ros <[email protected]>
  • Loading branch information
hishamco and sebastienros authored Nov 22, 2024
1 parent 69ad220 commit 0e8a243
Show file tree
Hide file tree
Showing 24 changed files with 114 additions and 87 deletions.
15 changes: 14 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
[*.cs]
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.cs]

# IDE0022: Use block body for method
csharp_style_expression_bodied_methods = when_on_single_line:silent
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Test
run: dotnet test -c Release
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Version
run: dotnet --version
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Install dependencies
run: dotnet restore
- name: Test
run: dotnet test -c Release --framework net8.0
run: dotnet test -c Release --framework net9.0
- name: Pack with dotnet
run: |
arrTag=(${GITHUB_REF//\// })
Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project>
<Import Project="Versions.props" />
<Import Project="Common.props" />
</Project>
24 changes: 16 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
<Project>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<!-- Global Package References -->
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<GlobalPackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />

<!-- TFM specific reference since they could lift some framework dependencies -->
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)" />

<!-- Only used with netstandard2.0 -->
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.0" />
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />

<!-- Common to all TFMs -->
<PackageVersion Include="Parlot" Version="1.0.2" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="TimeZoneConverter" Version="6.1.0" />
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />

<!-- Benchmarks -->
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="DotLiquid" Version="2.2.692" />
<PackageVersion Include="Liquid.NET" Version="0.10.0" />
<PackageVersion Include="Scriban" Version="5.12.0" />
<PackageVersion Include="Handlebars.Net" Version="2.1.6" />
<!-- Global Package References -->
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<GlobalPackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />

<!-- Testing -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.analyzers" Version="1.17.0" />
</ItemGroup>
</Project>
</Project>
12 changes: 6 additions & 6 deletions Fluid.Benchmarks/ComparisonBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;

namespace Fluid.Benchmarks
{
[MemoryDiagnoser, GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory), ShortRunJob]
public class ComparisonBenchmarks
{
private FluidBenchmarks _fluidBenchmarks = new FluidBenchmarks();
private HandlebarsBenchmarks _handlebarsBenchmarks = new HandlebarsBenchmarks();
private DotLiquidBenchmarks _dotLiquidBenchmarks = new DotLiquidBenchmarks();
private LiquidNetBenchmarks _liquidNetBenchmarks = new LiquidNetBenchmarks();
private ScribanBenchmarks _scribanBenchmarks = new ScribanBenchmarks();
private readonly FluidBenchmarks _fluidBenchmarks = new FluidBenchmarks();
private readonly HandlebarsBenchmarks _handlebarsBenchmarks = new HandlebarsBenchmarks();
private readonly DotLiquidBenchmarks _dotLiquidBenchmarks = new DotLiquidBenchmarks();
private readonly LiquidNetBenchmarks _liquidNetBenchmarks = new LiquidNetBenchmarks();
private readonly ScribanBenchmarks _scribanBenchmarks = new ScribanBenchmarks();

[Benchmark(Baseline = true), BenchmarkCategory("Parse")]
public object Fluid_Parse()
Expand Down
3 changes: 2 additions & 1 deletion Fluid.Benchmarks/Fluid.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<!-- Ignore vulnerable packages imported for benchmarking only -->
<NoWarn>$(NoWarn);NU1903</NoWarn>
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Fluid.MinimalApisSample/Fluid.MinimalApisSample.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<IsPackable>false</IsPackable>
<LangVersion>preview</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Fluid.MvcSample/Fluid.MvcSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<IsPackable>false</IsPackable>
Expand Down
10 changes: 0 additions & 10 deletions Fluid.MvcViewEngine/Directory.Build.props

This file was deleted.

16 changes: 9 additions & 7 deletions Fluid.MvcViewEngine/Fluid.MvcViewEngine.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<PackageIcon>logo_64x64.png</PackageIcon>
<IsPackable>true</IsPackable>
<PackageId>Fluid.MvcViewEngine</PackageId>
<Description>Fluid.MvcViewEngine is a view engine for ASP.NET Core MVC based on Liquid templates.</Description>
<!-- Ignore: The target framework '...' is out of support and will not receive security updates in the future -->
<NoWarn>$(NoWarn);NETSDK1138</NoWarn>
</PropertyGroup>
Expand All @@ -14,22 +16,22 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fluid\Fluid.csproj" />
<ProjectReference Include="..\Fluid.ViewEngine\Fluid.ViewEngine.csproj" />
<ProjectReference Include="..\Fluid\Fluid.csproj" />
<ProjectReference Include="..\Fluid.ViewEngine\Fluid.ViewEngine.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net9.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\Fluid\ExceptionHelper.cs">
<Link>ExceptionHelper.cs</Link>
Expand Down
3 changes: 2 additions & 1 deletion Fluid.Tests/Fluid.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<DefineConstants Condition="'$(Compiled)' == 'true'">$(DefineConstants);COMPILED</DefineConstants>
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 0 additions & 10 deletions Fluid.ViewEngine/Directory.Build.props

This file was deleted.

4 changes: 3 additions & 1 deletion Fluid.ViewEngine/Fluid.ViewEngine.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>true</IsPackable>
<PackageIcon>logo_64x64.png</PackageIcon>
<PackageId>Fluid.ViewEngine</PackageId>
<Description>Fluid.ViewEngine is a reusable library to build view engines based on Liquid templates. It supports Layouts, Sections, Bodies, ViewStarts like the Razor ASP.NET MVC engine.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Fluid.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluid.MvcViewEngine", "Flui
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{BE5EF08E-5F79-4BBA-BA72-F4E26E281125}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\build.yml = .github\workflows\build.yml
Common.props = Common.props
CREDITS.md = CREDITS.md
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
NuGet.config = NuGet.config
.github\workflows\pr.yml = .github\workflows\pr.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
README.md = README.md
Versions.props = Versions.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluid.ViewEngine", "Fluid.ViewEngine\Fluid.ViewEngine.csproj", "{3510D4C5-8328-4425-B2F1-B8591E85B965}"
Expand All @@ -32,9 +35,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluid.MinimalApisSample", "Fluid.MinimalApisSample\Fluid.MinimalApisSample.csproj", "{6390F2D4-564B-455E-9C02-3DB998E5BD09}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D1E1DE19-67EF-43C8-BC9A-53E60D65ECFE}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
17 changes: 0 additions & 17 deletions Fluid/Directory.Build.props

This file was deleted.

2 changes: 1 addition & 1 deletion Fluid/Filters/MiscFilters.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Fluid.Values;
using Fluid.Values;
using System.Buffers;
using System.Globalization;
using System.Net;
Expand Down
16 changes: 14 additions & 2 deletions Fluid/Fluid.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<IsPackable>true</IsPackable>
<PackageId>Fluid.Core</PackageId>
<Title>Fluid Template Engine</Title>
<Description>Fluid is a template engine based on the Liquid markup, with focus on performance and .NET programming patterns.</Description>
<PackageTags>fluid;liquid;template;view engine</PackageTags>
<PackageIcon>logo_64x64.png</PackageIcon>
<ImplicitUsings>true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Ingore missing comments errors and obsolete TFMs -->
Expand All @@ -25,6 +30,10 @@
<NoWarn>$(NoWarn);CA2012</NoWarn> <!-- CA2012: Use ValueTasks correctly -->
</PropertyGroup>

<ItemGroup>
<None Include="../Assets/logo_64x64.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Parlot" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" />
Expand All @@ -36,14 +45,17 @@
<PackageReference Include="Microsoft.CSharp" />
<PackageReference Include="System.Reflection.Emit.Lightweight" />
</ItemGroup>

<!-- Keep specific targets since it removes some dependencies -->
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net9.0'">
</ItemGroup>

<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down
5 changes: 0 additions & 5 deletions MinimalApis.LiquidViews/Directory.Build.props

This file was deleted.

2 changes: 1 addition & 1 deletion MinimalApis.LiquidViews/LiquidResults.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using MinimalApis.LiquidViews;
using MinimalApis.LiquidViews;

namespace Microsoft.AspNetCore.Http
{
Expand Down
12 changes: 4 additions & 8 deletions MinimalApis.LiquidViews/MinimalApis.LiquidViews.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>9</LangVersion>
<IsPackable>true</IsPackable>
<PackageIcon>logo_64x64.png</PackageIcon>
Expand All @@ -17,12 +17,8 @@
<ProjectReference Include="..\Fluid.ViewEngine\Fluid.ViewEngine.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" VersionOverride="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" VersionOverride="8.0.0" />
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -31,5 +27,5 @@
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Loading

0 comments on commit 0e8a243

Please sign in to comment.