Skip to content

Commit

Permalink
- Upgraded packages to support dotnet8
Browse files Browse the repository at this point in the history
  • Loading branch information
RonSijm committed Feb 28, 2024
1 parent 680ddeb commit c5c5f86
Show file tree
Hide file tree
Showing 29 changed files with 213 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src
- name: Build Debug
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_demo1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

# Install dotnet wasm buildtools workload
- name: Install .NET WASM Build Tools
Expand Down
13 changes: 13 additions & 0 deletions BuildSettings/DependencyInjectionAbstractionsForFramework.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.*" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions BuildSettings/NuGetVersioning.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<Authors>Ron Sijm</Authors>
<Company>Ron Sijm</Company>
<VersionPrefix>1.2.0</VersionPrefix>
</PropertyGroup>
</Project>
9 changes: 9 additions & 0 deletions BuildSettings/SupportedFrameworks.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<LangVersion>preview</LangVersion>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>Ron Sijm</Authors>
<Company>Ron Sijm</Company>
</PropertyGroup>
</Project>
13 changes: 13 additions & 0 deletions BuildSettings/WebAssemblyForFramework.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
{
if (args.Path == "fetchdata1")
{
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib1.dll" });
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib1.wasm" });
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdata2")
{
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib2.dll" });
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib2.wasm" });
}
else if (args.Path == "fetchdata3")
{
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib3.dll" });
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib3.wasm" });
}
else if (args.Path == "fetchdata4")
{
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib4.Page.dll" });
var assemblies = await BlazyAssemblyLoader.LoadAssembliesAsync(new[] { "RonSijm.Demo.Blazyload.WeatherLib4.Page.wasm" });
}
}
catch (Exception)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class DummyAuthHandler
{
public bool HandleAuth(string assembly, HttpRequestMessage httpMessage, BlazyAssemblyOptions assemblyOptions)
{
if (assembly == "RonSijm.Demo.Blazyload.WeatherLib2.dll")
if (assembly == "RonSijm.Demo.Blazyload.WeatherLib2.wasm")
{
httpMessage.Headers.Add("authorization", "Bearer eyJhb-mock-auth-header");
if (httpMessage.RequestUri != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected async Task HandleSubmitAndLoad()
if (Model != null)
{
AWSAuthHandler.SetCredentials(Model.BucketUrl, Model.AccessKey, Model.SecretKey);
await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib3.dll");
await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib3.wasm");
ButtonColor = "btn-success";
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.*" PrivateAssets="all" />
</ItemGroup>

<!--Between here and the bottom-->

<ItemGroup>
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib1.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib2.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib3.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Component.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Page.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib1.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib2.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib3.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Component.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Page.wasm" />
</ItemGroup>

<ItemGroup>
Expand All @@ -39,7 +39,12 @@
<!-- You'd have to leave out both the ProjectReference and the BlazorWebAssemblyLazyLoad though, otherwise the project is non-lazy-loaded -->
<!-- So leaving in all the project references is easiest. -->

<!-- Post build event to move files from framework -->
<!-- Pre build event to remove _framework folder -->
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="rd /s /q &quot;$(ProjectDir)wwwroot\_framework\&quot;" />
</Target>

<!-- Post build event to move files from framework -->
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="rd /s /q &quot;$(ProjectDir)wwwroot\_framework\WeatherLib1&quot; &amp; mkdir &quot;$(ProjectDir)wwwroot\_framework\WeatherLib1&quot;" />
<Exec Command="move /Y &quot;$(TargetDir)wwwroot\_framework\*WeatherLib1*&quot; &quot;$(ProjectDir)wwwroot\_framework\WeatherLib1&quot;" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'debug'">
<ProjectReference Include="..\..\..\src\RonSijm.Blazyload.Library\RonSijm.Blazyload.Library.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'debug'">
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'debug'">
<ProjectReference Include="..\..\..\src\RonSijm.Blazyload.Library\RonSijm.Blazyload.Library.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'debug'">
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions Examples/RonSijm.Demo.Blazyload.Host/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
{
if (args.Path == "fetchdata1")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib1.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib1.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdata2")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib2.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib2.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdata3")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib3.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib3.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdata4")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib4.Page.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLib4.Page.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdataOptionalNull")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLibOptionalNull.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLibOptionalNull.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
else if (args.Path == "fetchdataOptionalNotNull")
{
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLibOptionalNotNull.dll");
var assemblies = await BlazyAssemblyLoader.LoadAssemblyAsync("RonSijm.Demo.Blazyload.WeatherLibOptionalNotNull.wasm");
_lazyLoadedAssemblies.AddRange(assemblies);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib1.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib2.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib3.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Page.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Component.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLibOptionalNotNull.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLibOptionalNull.dll" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib1.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib2.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib3.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Page.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLib4.Component.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLibOptionalNotNull.wasm" />
<BlazorWebAssemblyLazyLoad Include="RonSijm.Demo.Blazyload.WeatherLibOptionalNull.wasm" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'debug'">
<ProjectReference Include="..\..\src\RonSijm.Blazyload.Library\RonSijm.Blazyload.Library.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'debug'">
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'debug'">
<!--TODO: Update after library nuget for .net8 has been published.-->
<!--<ItemGroup Condition="'$(Configuration)' == 'debug'">
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>-->

<ItemGroup Condition="'$(Configuration)' == 'debug'">
<ProjectReference Include="..\..\src\RonSijm.Blazyload.Library\RonSijm.Blazyload.Library.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'debug'">
<PackageReference Include="RonSijm.Blazyload.Library" Version="1.*" />
</ItemGroup>


</Project>

0 comments on commit c5c5f86

Please sign in to comment.