Skip to content

Commit

Permalink
Feature/net8 support (#1)
Browse files Browse the repository at this point in the history
* 1. Added .NET 8 support
1.1 Aligned package versions with respective targets (.NET 6, netstandard2.0, .NET 8.0)
1.2 Removed .NET 7.0 target
1.3 Removed direct targets on the library for .NET Framework and only left netstandard2.0 because of dependencies, netstandard2.0 reference required anyways and there is no point to split targets on the library itself.
2. StyleCop is deprecated
2.1 Removed StyleCop
2.2 Added Microsoft.CodeAnalysis.NetAnalyzers
2.3 Fixed nullable references issues and other minor issues
3. Moved packages for unit tests out of .props file
4. Upgraded xUnit
4.1 Fixed xUnit warnings
5. Upgraded the rest of packages in unit tests

Signed-off-by: Aliaksandr Kukrash <[email protected]>

* Explicitly enable NET Analyzers for all projects and move common project settings to .props file

Signed-off-by: Aliaksandr Kukrash <[email protected]>

* Test pipeline update

Signed-off-by: Aliaksandr Kukrash <[email protected]>

* Remove extra "UseDotNet" task since latest SDK should be sufficient

Signed-off-by: Aliaksandr Kukrash <[email protected]>

* Put latest SDK version as AppVeyor build failed as it cannot discover latest .NET version in dotnet-install.sh

Signed-off-by: Aliaksandr Kukrash <[email protected]>

---------

Signed-off-by: Aliaksandr Kukrash <[email protected]>
  • Loading branch information
multiarc authored Jan 12, 2025
1 parent 4d9be90 commit fc551ac
Show file tree
Hide file tree
Showing 71 changed files with 4,980 additions and 677 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ jobs:
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@v3.2.0
- name: "Install .NET 6.0 SDK"
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: |
6.0.x
global-json-file: "./global.json"
dotnet-version: 6.0.x
- name: "Install .NET 8.0 SDK"
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
- name: "Dotnet Tool Restore"
run: dotnet tool restore
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,4 @@ MigrationBackup/
.ionide/

Artefacts/
/.idea
3 changes: 3 additions & 0 deletions Benchmarks/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ dotnet_diagnostic.SA1602.severity = none
# Justification: Comments turned off
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1633.md
dotnet_diagnostic.SA1633.severity = none

# CA1515: Consider making public types internal
dotnet_diagnostic.CA1515.severity = none
30 changes: 15 additions & 15 deletions Benchmarks/Schema.NET.Benchmarks/Core/BookBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,68 @@ namespace Schema.NET.Benchmarks.Core;
public class BookBenchmark : SchemaBenchmarkBase
{
public override Thing InitialiseThing() =>
new Book()
new Book
{
Id = new Uri("https://example.com/book/1"),
Name = "The Catcher in the Rye",
Author = new Person()
Author = new Person
{
Name = "J.D. Salinger",
},
Url = new Uri("https://www.barnesandnoble.com/store/info/offer/JDSalinger"),
WorkExample = new List<ICreativeWork>()
WorkExample = new List<ICreativeWork?>
{
new Book()
new Book
{
Isbn = "031676948",
BookEdition = "2nd Edition",
BookFormat = BookFormatType.Hardcover,
PotentialAction = new ReadAction()
PotentialAction = new ReadAction
{
Target = new EntryPoint()
Target = new EntryPoint
{
UrlTemplate = "https://www.barnesandnoble.com/store/info/offer/0316769487?purchase=true",
ActionPlatform = new List<Uri>()
ActionPlatform = new List<Uri?>
{
new Uri("https://schema.org/DesktopWebPlatform"),
new Uri("https://schema.org/IOSPlatform"),
new Uri("https://schema.org/AndroidPlatform"),
},
},
ExpectsAcceptanceOf = new Offer()
ExpectsAcceptanceOf = new Offer
{
Price = 6.99M,
PriceCurrency = "USD",
EligibleRegion = new Country()
EligibleRegion = new Country
{
Name = "US",
},
Availability = ItemAvailability.InStock,
},
},
},
new Book()
new Book
{
Isbn = "031676947",
BookEdition = "1st Edition",
BookFormat = BookFormatType.EBook,
PotentialAction = new ReadAction()
PotentialAction = new ReadAction
{
Target = new EntryPoint()
Target = new EntryPoint
{
UrlTemplate = "https://www.barnesandnoble.com/store/info/offer/031676947?purchase=true",
ActionPlatform = new List<Uri>()
ActionPlatform = new List<Uri?>
{
new Uri("https://schema.org/DesktopWebPlatform"),
new Uri("https://schema.org/IOSPlatform"),
new Uri("https://schema.org/AndroidPlatform"),
},
},
ExpectsAcceptanceOf = new Offer()
ExpectsAcceptanceOf = new Offer
{
Price = 1.99M,
PriceCurrency = "USD",
EligibleRegion = new Country()
EligibleRegion = new Country
{
Name = "UK",
},
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/Schema.NET.Benchmarks/Core/WebsiteBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Schema.NET.Benchmarks.Core;
public class WebsiteBenchmark : SchemaBenchmarkBase
{
public override Thing InitialiseThing() =>
new WebSite()
new WebSite
{
PotentialAction = new SearchAction()
PotentialAction = new SearchAction
{
Target = new Uri("https://example.com/search?&q={query}"),
QueryInput = "required",
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/Schema.NET.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Schema.NET.Benchmarks;

using BenchmarkDotNet.Running;

public class Program
internal static class Program
{
private static void Main(string[] args) =>
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
Expand Down
5 changes: 3 additions & 2 deletions Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
<TargetFrameworks>net7.0;net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net462;net472;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>

<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Source\Schema.NET\Schema.NET.csproj" />
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="BenchmarkDotNet" Version="0.13.8" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>

</Project>
4 changes: 3 additions & 1 deletion Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ namespace Schema.NET.Benchmarks;
[HtmlExporter]
[CsvMeasurementsExporter]
[RPlotExporter]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.Net80)]
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net462)]
[SimpleJob(RuntimeMoniker.Net472)]
[SimpleJob(RuntimeMoniker.Net48)]
public abstract class SchemaBenchmarkBase
{
public Thing Thing { get; set; } = default!;
Expand Down
Loading

0 comments on commit fc551ac

Please sign in to comment.