Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump to net9 #31

Merged
merged 6 commits into from
Oct 25, 2024
Merged
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
10 changes: 6 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
build_and_deploy_job:
env:
DIST_PATH: src/samples/EFCoreSample/EFCoreSample.Wasm/bin/Release/net8.0/dist
DIST_PATH: src/samples/EFCoreSample/EFCoreSample.Wasm/bin/Release/net9.0/publish/wwwroot

if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
Expand All @@ -40,14 +40,16 @@ jobs:

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100'
dotnet-version: '9.0.100-rc.2.24474.11'
include-prerelease: true

- run: dotnet workload install wasm-tools

- run: |
cd src/samples/EFCoreSample/EFCoreSample.Wasm
dotnet build -c Release "/p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }}"
dotnet publish -c Release "/p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }}"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: wasm-site
path: ${{ env.DIST_PATH }}
Expand Down
15 changes: 10 additions & 5 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ jobs:
- task: UseDotNet@2
displayName: 'Use .NET SDK'
inputs:
version: 8.0.100
version: 9.0.100-rc.2.24474.11
includePreviewVersions: true

- powershell: dotnet workload install wasm-tools
displayName: 'Install .NET Wasm Workload'

- powershell: |
dotnet build /r /p:Configuration=Release src/SQLitePCLRaw.Wasm-ci.slnf "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$env:GITVERSION_FullSemVer" "/p:InformationalVersion=$env:GITVERSION_InformationalVersion" /detailedsummary

Expand Down Expand Up @@ -78,17 +81,19 @@ jobs:
- task: UseDotNet@2
displayName: 'Use .NET SDK'
inputs:
version: 8.0.100
version: 9.0.100-rc.2.24474.11
includePreviewVersions: true

- bash: |
dotnet build -c Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$GITVERSION_FULLSEMVER" "/p:InformationalVersion=$GITVERSION_INFORMATIONALVERSION" ./src/samples/EFCoreSample/EFCoreSample.Wasm/EFCoreSample.Wasm.csproj
- bash: dotnet workload install wasm-tools
displayName: 'Install .NET Wasm Workload'

- bash: |
dotnet publish -c Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$GITVERSION_FULLSEMVER" "/p:InformationalVersion=$GITVERSION_INFORMATIONALVERSION" ./src/samples/EFCoreSample/EFCoreSample.Wasm/EFCoreSample.Wasm.csproj
displayName: 'Build Wasm Head'

- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
inputs:
pathToPublish: ./src/samples/EFCoreSample/EFCoreSample.Wasm/bin/Release/net8.0/dist
pathToPublish: ./src/samples/EFCoreSample/EFCoreSample.Wasm/bin/Release/net9.0/publish/wwwroot
artifactType: container
artifactName: EFCoreSample-Wasm
7 changes: 7 additions & 0 deletions src/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<add key="unoplatformdev" value="https://pkgs.dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_packaging/unoplatformdev/nuget/v3/index.json" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,18 @@ private string GetAssemblyVersion(Type t)

private async void Run_Click(object sender, RoutedEventArgs e)
{
try
{
#if __WASM__
await SampleRunner.RunSample(codeBlock.Text.Replace("\\n", "\n"));
await SampleRunner.RunSample(codeBlock.Text.Replace("\\n", "\n"));
#else
await SampleClass.Run();
#endif
}
catch(Exception ex)
{
output.Text += ex.ToString();
}
}

private class TextBlockTextWriter : TextWriter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<WasmHead>true</WasmHead>
<DefineConstants>$(DefineConstants);__WASM__</DefineConstants>
<NoWarn>NU1701</NoWarn>
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling>
<WasmShellNinjaAdditionalParameters>-v</WasmShellNinjaAdditionalParameters>
<WasmBuildNative>true</WasmBuildNative>
</PropertyGroup>
<ItemGroup>
<Content Include="..\EFCoreSample.UWP\Assets\*.png" Link="Assets\%(FileName)%(Extension)" />
<WasmShellExtraEmccFlags Include="-lidbfs.js" />
<WasmShellEmccExportedRuntimeMethod Include="IDBFS" />
</ItemGroup>
<ItemGroup>
<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
Expand All @@ -30,12 +32,12 @@

<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.3.0-dev.1" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.118" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.6.0-dev.228" />
<PackageReference Include="Uno.Core" Version="4.0.1" />
<PackageReference Include="Uno.WinUI.WebAssembly" Version="5.0.118" />
<PackageReference Include="Uno.WinUI.WebAssembly" Version="5.6.0-dev.228" />
<PackageReference Include="Uno.WinUI.Sample.Banner" Version="1.45.0-dev.64" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="8.0.4" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="8.0.4" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="9.0.1" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="9.0.1" />
<PackageReference Include="SQLitePCLRaw.bundle_sqlite3" Version="2.1.8" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.8" />

Expand Down Expand Up @@ -66,7 +68,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Uno.sqlite-wasm" Version="3.40.0.2" />
<PackageReference Include="Uno.sqlite-wasm" Version="3.40.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
29 changes: 23 additions & 6 deletions src/samples/EFCoreSample/EFCoreSample.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using System;
// #define ENABLE_EXCEPTIONS_LOGGING

using System;
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging;
using Uno;
using Uno.Extensions;
using Microsoft.UI.Xaml;
using System.Runtime.InteropServices;

namespace EFCoreSample.Wasm
{
Expand All @@ -12,7 +15,12 @@ public class Program
private static App _app;

static void Main(string[] args)
{
{
#if ENABLE_EXCEPTIONS_LOGGING
MonoInternals.mono_trace_enable(1);
MonoInternals.mono_trace_set_options("E:all");
#endif

#if DEBUG
InitializeLogging();
#endif
Expand All @@ -38,12 +46,12 @@ private static void InitializeLogging()
#endif

// Exclude logs below this level
builder.SetMinimumLevel(LogLevel.Information);
builder.SetMinimumLevel(LogLevel.Trace);

// Default filters for Uno Platform namespaces
builder.AddFilter("Uno", LogLevel.Warning);
builder.AddFilter("Windows", LogLevel.Warning);
builder.AddFilter("Microsoft", LogLevel.Warning);
builder.AddFilter("Uno", LogLevel.Trace);
builder.AddFilter("Windows", LogLevel.Trace);
builder.AddFilter("Microsoft", LogLevel.Trace);

// Generic Xaml events
// builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug );
Expand Down Expand Up @@ -76,4 +84,13 @@ private static void InitializeLogging()
global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory;
}
}

static class MonoInternals
{
[DllImport("__Native")]
internal static extern void mono_trace_enable(int enable);

[DllImport("__Native")]
internal static extern int mono_trace_set_options(string options);
}
}
Binary file not shown.
Loading