Skip to content

Commit b19ae4b

Browse files
authored
Merge pull request #80 from rbergen/upgrade-net10
Upgrade to .NET 10
2 parents e0626f5 + 29e1d92 commit b19ae4b

14 files changed

Lines changed: 99 additions & 44 deletions

.github/workflows/github-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: 8.0.x
21+
dotnet-version: 10.0.x
2222

2323
- name: Install wasm-tools for AOT compilation
24-
run: dotnet workload install wasm-tools-net8
24+
run: dotnet workload install wasm-tools
2525

2626
- name: Publish Frontend project
2727
run: dotnet publish src/Frontend/Frontend.csproj -c Release -o release --nologo

src/Entities/Entities.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<RootNamespace>PrimeView.Entities</RootNamespace>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>

src/Frontend/App.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
1+
<Router AppAssembly="@typeof(Program).Assembly">
22
<Found Context="routeData">
33
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
44
</Found>

src/Frontend/Filters/LeaderboardFilterPreset.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public LeaderboardFilterPreset()
99
Name = "Leaderboard";
1010
ImplementationText = string.Empty;
1111
ParallelismText = Constants.MultithreadedTag;
12-
AlgorithmText = new string[] { Constants.WheelTag, Constants.OtherTag }.JoinFilterValues();
12+
AlgorithmText = new[] { Constants.WheelTag, Constants.OtherTag }.JoinFilterValues();
1313
FaithfulText = Constants.UnfaithfulTag;
14-
BitsText = new string[] { Constants.UnknownTag, Constants.OtherTag }.JoinFilterValues();
14+
BitsText = new[] { Constants.UnknownTag, Constants.OtherTag }.JoinFilterValues();
1515
}
1616

1717
public override bool IsFixed => true;

src/Frontend/Filters/MultithreadedLeaderboardFilterPreset.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public MultithreadedLeaderboardFilterPreset()
99
Name = "Multithreaded leaderboard";
1010
ImplementationText = string.Empty;
1111
ParallelismText = Constants.SinglethreadedTag;
12-
AlgorithmText = new string[] { Constants.WheelTag, Constants.OtherTag }.JoinFilterValues();
12+
AlgorithmText = new[] { Constants.WheelTag, Constants.OtherTag }.JoinFilterValues();
1313
FaithfulText = Constants.UnfaithfulTag;
14-
BitsText = new string[] { Constants.UnknownTag, Constants.OtherTag }.JoinFilterValues();
14+
BitsText = new[] { Constants.UnknownTag, Constants.OtherTag }.JoinFilterValues();
1515
}
1616

1717
public override bool IsFixed => true;

src/Frontend/Frontend.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22
<PropertyGroup>
33
<RootNamespace>PrimeView.Frontend</RootNamespace>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<RunAOTCompilation>true</RunAOTCompilation>
66
</PropertyGroup>
77
<ItemGroup>
@@ -11,9 +11,9 @@
1111
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
1212
<PackageReference Include="BlazorTable" Version="1.17.0" />
1313
<PackageReference Include="CsvHelper" Version="33.1.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
16-
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" />
16+
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="10.0.0" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<ProjectReference Include="..\JsonFileReader\JsonFileReader.csproj" />

src/Frontend/wwwroot/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"IsS3Bucket": "true"
1010
},
1111
"RestAPIReader": {
12-
"APIBaseURI": ""
12+
"APIBaseURI": "https://primes.marghidanu.com/v1/"
1313
}
1414
}
1515
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<RootNamespace>PrimeView.JsonFileReader</RootNamespace>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
@@ -11,7 +11,7 @@
1111
<ProjectReference Include="..\Entities\Entities.csproj" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="microsoft.extensions.configuration.binder" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
14+
<PackageReference Include="microsoft.extensions.configuration.binder" Version="10.0.0" />
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
1616
</ItemGroup>
1717
</Project>

src/JsonFileReader/ReportReader.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,17 @@
99

1010
namespace PrimeView.JsonFileReader
1111
{
12-
public class ReportReader : IReportReader
12+
public class ReportReader(string baseAddress, IConfiguration configuration) : IReportReader
1313
{
1414
private List<ReportSummary>? summaries;
1515
private Dictionary<string, Report>? reportMap;
16-
private readonly HttpClient httpClient;
17-
private readonly string? indexFileName;
18-
private readonly bool isS3Bucket;
16+
private readonly HttpClient httpClient = new() { BaseAddress = new Uri(configuration.GetValue(Constants.BaseURI, baseAddress) ?? baseAddress) };
17+
private readonly string? indexFileName = configuration.GetValue<string?>(Constants.Index, null);
18+
private readonly bool isS3Bucket = configuration.GetValue(Constants.IsS3Bucket, false);
1919
private bool haveJsonFilesLoaded = false;
2020
private bool reachedMaxFileCount = false;
2121
private int totalReports = 0;
2222

23-
public ReportReader(string baseAddress, IConfiguration configuration)
24-
{
25-
this.httpClient = new HttpClient { BaseAddress = new Uri(configuration.GetValue(Constants.BaseURI, baseAddress) ?? baseAddress) };
26-
this.indexFileName = configuration.GetValue<string?>(Constants.Index, null);
27-
this.isS3Bucket = configuration.GetValue(Constants.IsS3Bucket, false);
28-
}
29-
3023
private async Task<Report?> LoadReportJsonFile(string fileName)
3124
{
3225
if (string.IsNullOrEmpty(fileName))

src/RestAPIReader/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
static class Constants
44
{
55
public const string APIBaseURI = nameof(APIBaseURI);
6+
public const string PrimesAPI = nameof(PrimesAPI);
67
}
78
}

0 commit comments

Comments
 (0)