This commit is contained in:
Jerome Laban 2020-11-04 21:51:46 -05:00
Родитель 48d062a669
Коммит 392847de20
265 изменённых файлов: 1863 добавлений и 591 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -268,3 +268,4 @@ launchSettings.json
.DS_Store
thumbs.db
/src/Uno.Wasm.Bootstrap/build/packager
/src/Uno.Wasm.Bootstrap/build/wasm-tuner

Просмотреть файл

@ -24,21 +24,7 @@ jobs:
- checkout: self
clean: true
# Select .NET Core 2.2 for gitversion@5
- task: UseDotNet@2
condition: ne(variables['NETCORE_VERSION'], '2.2.x')
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 2.2.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: GitVersion@5
inputs:
runtime: 'core'
useConfigFile: true
configFilePath: gitversion.yml
updateAssemblyInfo: false
- template: build/ci/gitversion.yml
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
@ -48,20 +34,30 @@ jobs:
version: ${{ parameters.netcore_version }}
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: UseDotNet@2
displayName: 'Install .NET 5 SDK'
inputs:
packageType: sdk
version: 5.0.100-rc.2.20479.15
includePreviewVersions: true
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.9.1
checkLatest: false
- bash: |
msbuild /r /t:Publish /p:Configuration=Release src/Uno.Wasm.Bootstrap.sln
displayName: Build
cd $(build.sourcesdirectory)/src/Uno.Wasm.Sample
dotnet msbuild /r /p:Configuration=Release || true # expected failure (nuget restore does not provide the packager a proper TargetFramework support)
dotnet msbuild /r /p:Configuration=Release || true # expected failure (nuget restore does not provide the iltrim a proper TargetFramework support)
dotnet msbuild /r /p:Configuration=Release -m:1
displayName: Build Mono Sample
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Sample
dotnet build || true # expected failure (nuget restore does not provide the packager a proper TargetFramework support)
dotnet build
cd $(build.sourcesdirectory)/src
dotnet msbuild /r /p:Configuration=Release /t:Publish /m:1 Uno.Wasm.Bootstrap-netcore-only.slnf /bl:$(build.artifactstagingdirectory)/SampleNet5.binlog
displayName: Build NetCore-Wasm Sample
- task: CopyFiles@2
inputs:

Просмотреть файл

@ -15,6 +15,15 @@ jobs:
SourceLinkEnabled: false
steps:
- template: build/ci/gitversion.yml
- task: UseDotNet@2
displayName: 'Install .NET 5 SDK'
inputs:
packageType: sdk
version: 5.0.100-rc.2.20479.15
includePreviewVersions: true
- bash: |
cd $(Agent.WorkFolder)
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip
@ -32,28 +41,35 @@ jobs:
displayName: 'Setup Emscripten'
# - bash: |
# source ~/emsdk/emsdk_env.sh
# export PATH=$PATH:$(Agent.WorkFolder)/ninja-mac
# msbuild /r /t:Publish /p:Configuration=Release src/Uno.Wasm.Bootstrap.sln
#
# displayName: MSBuild Validation
# - task: CopyFiles@2
# inputs:
# SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.AotTests/bin/Release/netstandard2.0/dist
# Contents: '**/*.*'
# TargetFolder: $(build.artifactstagingdirectory)
# CleanTargetFolder: false
# OverWrite: false
# flattenFolders: false
- bash: |
source ~/emsdk/emsdk_env.sh
export PATH=$PATH:$(Agent.WorkFolder)/ninja-mac
msbuild /r /t:Publish /p:Configuration=Release src/Uno.Wasm.Bootstrap.sln
displayName: MSBuild Validation
- task: CopyFiles@2
inputs:
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.AotTests/bin/Release/netstandard2.0/dist
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Sample
dotnet build || true # expected failure (nuget restore does not provide the packager a proper TargetFramework support)
dotnet build
dotnet build || true # expected failure (nuget restore does not provide the iltrim a proper TargetFramework support)
dotnet build -m:1
displayName: .NET Core Validation
displayName: Build Mono Sample
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.SampleNet5
dotnet build -m:1 /bl:$(build.artifactstagingdirectory)/SampleNet5-mac.binlog
displayName: Build NetCore-Wasm Sample
- task: PublishBuildArtifacts@1
condition: always()

Просмотреть файл

@ -11,16 +11,26 @@ jobs:
- checkout: self
clean: true
- task: UseDotNet@2
displayName: 'Install .NET 5 SDK'
inputs:
packageType: sdk
version: 5.0.100-rc.2.20479.15
includePreviewVersions: true
- task: UseDotNet@2
displayName: 'Install .NET 3.1.403'
inputs:
packageType: sdk
version: 3.1.403
- template: build/ci/gitversion.yml
- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.9.1
checkLatest: false
- task: GitVersion@5
inputs:
useConfigFile: true
configFilePath: gitversion.yml
updateAssemblyInfo: false
- powershell: |
$ErrorActionPreference = 'SilentlyContinue'
@ -35,8 +45,18 @@ jobs:
displayName: UI Tests npm dependencies
- powershell: .\build\build.ps1 -script build\build.cake
displayName: Build
- task: MSBuild@1
inputs:
solution: $(build.sourcesdirectory)/src/Uno.Wasm.Bootstrap-msbuild-only.slnf
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /bl /p:Configuration=Release /p:InformationalVersion=$(GITVERSION.INFORMATIONALVERSION) /p:PackageVersion=$(GITVERSION.FullSemVer) /p:PackageOutputPath=$(build.sourcesdirectory)\build\nuget
clean: false
maximumCpuCount: false
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false
- powershell: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Node.Sample.Runner
@ -61,7 +81,7 @@ jobs:
parameters:
jobName: Linux_netcore3_1
netcore_version: 3.1.201
linux_container: unoplatform/wasm-build:2.3
linux_container: unoplatform/wasm-build:3.0
- template: .vsts-ci-macos.yml
parameters:

Просмотреть файл

@ -1,153 +0,0 @@
#addin "nuget:?package=Cake.FileHelpers"
#addin "nuget:?package=Cake.Powershell"
#tool "nuget:?package=GitVersion.CommandLine&version=5.0.0"
#tool nuget:?package=vswhere
using System;
using System.Linq;
using System.Text.RegularExpressions;
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
//////////////////////////////////////////////////////////////////////
// VERSIONS
//////////////////////////////////////////////////////////////////////
var gitVersioningVersion = "2.0.41";
var signClientVersion = "0.9.0";
//////////////////////////////////////////////////////////////////////
// VARIABLES
//////////////////////////////////////////////////////////////////////
var baseDir = MakeAbsolute(Directory("../")).ToString();
var buildDir = baseDir + "/build";
var Solution = baseDir + "/src/Uno.Wasm.Bootstrap.sln";
var toolsDir = buildDir + "/tools";
GitVersion versionInfo = null;
//////////////////////////////////////////////////////////////////////
// METHODS
//////////////////////////////////////////////////////////////////////
void VerifyHeaders(bool Replace)
{
var header = FileReadText("header.txt") + "\r\n";
bool hasMissing = false;
Func<IFileSystemInfo, bool> exclude_objDir =
fileSystemInfo => !fileSystemInfo.Path.Segments.Contains("obj");
var files = GetFiles(baseDir + "/**/*.cs", exclude_objDir).Where(file =>
{
var path = file.ToString();
return !(path.EndsWith(".g.cs") || path.EndsWith(".i.cs") || System.IO.Path.GetFileName(path).Contains("TemporaryGeneratedFile"));
});
Information("\nChecking " + files.Count() + " file header(s)");
foreach(var file in files)
{
var oldContent = FileReadText(file);
if(oldContent.Contains("// <auto-generated>"))
{
continue;
}
var rgx = new Regex("^(//.*\r?\n|\r?\n)*");
var newContent = header + rgx.Replace(oldContent, "");
if(!newContent.Equals(oldContent, StringComparison.Ordinal))
{
if(Replace)
{
Information("\nUpdating " + file + " header...");
FileWriteText(file, newContent);
}
else
{
Error("\nWrong/missing header on " + file);
hasMissing = true;
}
}
}
if(!Replace && hasMissing)
{
throw new Exception("Please run UpdateHeaders.bat or '.\\build.ps1 -target=UpdateHeaders' and commit the changes.");
}
}
//////////////////////////////////////////////////////////////////////
// DEFAULT TASK
//////////////////////////////////////////////////////////////////////
Task("Build")
.IsDependentOn("Version")
.Description("Build all projects and get the assemblies")
.Does(() =>
{
Information("\nBuilding Solution");
var buildSettings = new MSBuildSettings
{
}
.SetConfiguration("Release")
.WithProperty("PackageVersion", versionInfo.FullSemVer)
.WithProperty("InformationalVersion", versionInfo.InformationalVersion)
.WithProperty("PackageOutputPath", System.IO.Path.Combine(buildDir, "nuget"))
.WithTarget("Restore")
.WithTarget("Build")
.WithTarget("Pack");
MSBuild(Solution, buildSettings);
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Build");
Task("UpdateHeaders")
.Description("Updates the headers in *.cs files")
.Does(() =>
{
VerifyHeaders(true);
});
Task("Version")
.Description("Updates target versions")
.Does(() =>
{
versionInfo = GitVersion(new GitVersionSettings {
UpdateAssemblyInfo = true,
UpdateAssemblyInfoFilePath = baseDir + "/build/AssemblyVersion.cs"
});
Information($"FullSemVer: {versionInfo.FullSemVer} Sha: {versionInfo.Sha}");
var files = new[] {
@"..\src\Uno.Wasm.Bootstrap\Uno.Wasm.Bootstrap.csproj",
@"..\src\Uno.Wasm.Bootstrap\ShellTask.cs",
@"..\src\Uno.Wasm.Bootstrap\UnoInstallSDKTask.cs",
@"..\src\Uno.Wasm.Bootstrap\build\Uno.Wasm.Bootstrap.targets"
};
foreach(var file in files)
{
var text = System.IO.File.ReadAllText(file);
System.IO.File.WriteAllText(file, text.Replace("v0", "v" + versionInfo.Sha));
}
});
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);

Просмотреть файл

@ -1,235 +0,0 @@
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER ShowDescription
Shows description about tasks.
.PARAMETER DryRun
Performs a dry run.
.PARAMETER Experimental
Uses the nightly builds of the Roslyn script engine.
.PARAMETER Mono
Uses the Mono Compiler rather than the Roslyn script engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
https://cakebuild.net
#>
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target,
[string]$Configuration,
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity,
[switch]$ShowDescription,
[Alias("WhatIf", "Noop")]
[switch]$DryRun,
[switch]$Experimental,
[switch]$Mono,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}
[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}
function GetProxyEnabledWebClient
{
$wc = New-Object System.Net.WebClient
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$wc.Proxy = $proxy
return $wc
}
Write-Host "Preparing to run build script..."
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"
# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type directory | out-null
}
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}
# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}
# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}
# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE
# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR
# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery |
Remove-Item -Recurse
}
Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}
# Restore addins from NuGet
if (Test-Path $ADDINS_PACKAGES_CONFIG) {
Push-Location
Set-Location $ADDINS_DIR
Write-Verbose -Message "Restoring addins from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet addins."
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}
# Restore modules from NuGet
if (Test-Path $MODULES_PACKAGES_CONFIG) {
Push-Location
Set-Location $MODULES_DIR
Write-Verbose -Message "Restoring modules from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet modules."
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}
# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}
# Build Cake arguments
$cakeArguments = @("$Script");
if ($Target) { $cakeArguments += "-target=$Target" }
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
if ($ShowDescription) { $cakeArguments += "-showdescription" }
if ($DryRun) { $cakeArguments += "-dryrun" }
if ($Experimental) { $cakeArguments += "-experimental" }
if ($Mono) { $cakeArguments += "-mono" }
$cakeArguments += $ScriptArgs
# Start Cake
Write-Host "Running build script..."
&$CAKE_EXE $cakeArguments
exit $LASTEXITCODE

18
build/ci/gitversion.yml Normal file
Просмотреть файл

@ -0,0 +1,18 @@
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 3.1.x'
inputs:
packageType: runtime
version: 3.1.3
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
updateAssemblyInfo: 'False'
useConfigFile: true
configFilePath: $(build.sourcesdirectory)/gitversion.yml
displayName: Run GitVersion

Просмотреть файл

@ -1,6 +1,6 @@
assembly-versioning-scheme: MajorMinorPatch
mode: Mainline
next-version: 1.5
next-version: 2.0
branches:
master:

Просмотреть файл

@ -0,0 +1,30 @@
{
"solution": {
"path": "Uno.Wasm.Bootstrap.sln",
"projects": [
"LongPathTest\\Uno.Wasm.LongPath.csproj",
"Uno.Wasm.AotTests\\Uno.Wasm.AotTests.csproj",
"Uno.Wasm.Bootstrap.Cli\\Uno.Wasm.Bootstrap.Cli.csproj",
"Uno.Wasm.Bootstrap.DevServer\\Uno.Wasm.Bootstrap.DevServer.csproj",
"Uno.Wasm.Bootstrap\\Uno.Wasm.Bootstrap.csproj",
"Uno.Wasm.MixedModeRoslynSample\\Uno.Wasm.MixedModeRoslynSample.csproj",
"Uno.Wasm.MixedModeSample\\Uno.Wasm.MixedModeSample.csproj",
"Uno.Wasm.Node.Sample.Runner\\Uno.Wasm.Node.Sample.Runner.njsproj",
"Uno.Wasm.Node.Sample\\Uno.Wasm.Node.Sample.csproj",
"Uno.Wasm.Sample\\Uno.Wasm.Sample.csproj",
"Uno.Wasm.Static Linking\\Uno.Wasm.StaticLinking.csproj",
"Uno.Wasm.StaticLinking.Aot.UITests\\Uno.Wasm.StaticLinking.Aot.UITests.njsproj",
"Uno.Wasm.StaticLinking.Aot\\Uno.Wasm.StaticLinking.Aot.csproj",
"Uno.Wasm.StaticLinking.Interpreter\\Uno.Wasm.StaticLinking.Interpreter.csproj",
"Uno.Wasm.Tests.Electron\\Uno.Wasm.Tests.Electron.csproj",
"Uno.Wasm.Tests.Empty\\Uno.Wasm.Test.Empty.csproj",
"Uno.Wasm.Tests.TypeScript\\Uno.Wasm.Tests.TypeScript.csproj",
"Uno.Wasm.Threading.UITests\\Uno.Wasm.Threading.UITests.njsproj",
"Uno.Wasm.Threads\\Uno.Wasm.Threads.csproj",
"Uno.Wasm.TimezoneData\\Uno.Wasm.TimezoneData.csproj",
"Uno.WasmSample WithSpace Aot\\Uno.WasmSample.WithSpace.Aot.csproj",
"Uno.WasmSample WithSpace\\Uno.WasmSample.WithSpace.csproj",
"WasmAot.UITests\\WasmAot.UITests.njsproj"
]
}
}

Просмотреть файл

@ -0,0 +1,29 @@
{
"solution": {
"path": "Uno.Wasm.Bootstrap.sln",
"projects": [
"LongPathTest\\Uno.Wasm.LongPath.csproj",
"Uno.Wasm.AotTests\\Uno.Wasm.AotTests.csproj",
"Uno.Wasm.Bootstrap.Cli\\Uno.Wasm.Bootstrap.Cli.csproj",
"Uno.Wasm.Bootstrap.DevServer\\Uno.Wasm.Bootstrap.DevServer.csproj",
"Uno.Wasm.Bootstrap\\Uno.Wasm.Bootstrap.csproj",
"Uno.Wasm.MixedModeRoslynSample\\Uno.Wasm.MixedModeRoslynSample.csproj",
"Uno.Wasm.MixedModeSample\\Uno.Wasm.MixedModeSample.csproj",
"Uno.Wasm.Node.Sample.Runner\\Uno.Wasm.Node.Sample.Runner.njsproj",
"Uno.Wasm.Node.Sample\\Uno.Wasm.Node.Sample.csproj",
"Uno.Wasm.SampleNet5.Aot\\Uno.Wasm.SampleNet5.Aot.csproj",
"Uno.Wasm.SampleNet5\\Uno.Wasm.SampleNet5.csproj",
"Uno.Wasm.Sample\\Uno.Wasm.Sample.csproj",
"Uno.Wasm.Static Linking\\Uno.Wasm.StaticLinking.csproj",
"Uno.Wasm.StaticLinking.Aot\\Uno.Wasm.StaticLinking.Aot.csproj",
"Uno.Wasm.StaticLinking.Interpreter\\Uno.Wasm.StaticLinking.Interpreter.csproj",
"Uno.Wasm.Tests.Electron\\Uno.Wasm.Tests.Electron.csproj",
"Uno.Wasm.Tests.Empty\\Uno.Wasm.Test.Empty.csproj",
"Uno.Wasm.Tests.TypeScript\\Uno.Wasm.Tests.TypeScript.csproj",
"Uno.Wasm.Threads\\Uno.Wasm.Threads.csproj",
"Uno.Wasm.TimezoneData\\Uno.Wasm.TimezoneData.csproj",
"Uno.WasmSample WithSpace Aot\\Uno.WasmSample.WithSpace.Aot.csproj",
"Uno.WasmSample WithSpace\\Uno.WasmSample.WithSpace.csproj"
]
}
}

Просмотреть файл

@ -19,7 +19,12 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
#if NETCOREAPP3_1
using WebAssembly.Net.Debugging;
#elif NET5_0
using Microsoft.WebAssembly.Diagnostics;
#endif
namespace Uno.Wasm.Bootstrap.Cli.DebuggingProxy
{
@ -62,9 +67,16 @@ namespace Uno.Wasm.Bootstrap.Cli.DebuggingProxy
var browserUri = new Uri(context.Request.Query["browser"]);
var ideSocket = await context.WebSockets.AcceptWebSocketAsync();
await new DebuggerProxy(loggerFactory).Run(browserUri, ideSocket);
await GetProxy(loggerFactory).Run(browserUri, ideSocket);
}
private static DebuggerProxy GetProxy(ILoggerFactory loggerFactory) =>
#if NETCOREAPP3_1
new DebuggerProxy(loggerFactory);
#elif NET5_0
new DebuggerProxy(loggerFactory, new List<string>());
#endif
private static async Task DebugHome(HttpContext context)
{
context.Response.ContentType = "text/html";

Просмотреть файл

@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Threading.Tasks;
@ -18,7 +19,12 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
#if NETCOREAPP3_1
using WebAssembly.Net.Debugging;
#elif NET5_0
using Microsoft.WebAssembly.Diagnostics;
#endif
namespace Uno.Wasm.Bootstrap.Cli.DebuggingProxy
{
@ -124,7 +130,7 @@ namespace Uno.Wasm.Bootstrap.Cli.DebuggingProxy
{
using var loggerFactory = LoggerFactory.Create(
builder => builder.AddConsole().AddFilter(null, LogLevel.Trace));
var proxy = new DebuggerProxy(loggerFactory);
var proxy = GetProxy(loggerFactory);
var ideSocket = await context.WebSockets.AcceptWebSocketAsync();
await proxy.Run(endpoint, ideSocket);
@ -138,6 +144,13 @@ namespace Uno.Wasm.Bootstrap.Cli.DebuggingProxy
return app;
}
private static DebuggerProxy GetProxy(ILoggerFactory loggerFactory) =>
#if NETCOREAPP3_1
new DebuggerProxy(loggerFactory);
#elif NET5_0
new DebuggerProxy(loggerFactory, new List<string>());
#endif
static async Task<T> ProxyGetJsonAsync<T>(string url)
{
using (var httpClient = new HttpClient())

Двоичные данные
src/Uno.Wasm.Bootstrap.Cli/External/net5/BrowserDebugProxy.dll поставляемый Normal file

Двоичный файл не отображается.

Просмотреть файл

Двоичные данные
src/Uno.Wasm.Bootstrap.Cli/External/netcoreapp3.1/Mono.Cecil.dll поставляемый Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -63,7 +63,9 @@ namespace Uno.Wasm.Bootstrap.Cli.Server
//
// Resolve the debugger content from the files copied over from the Wasm SDK folder.
//
var isDebuggerFile = e.Name.StartsWith("Mono.Cecil") || e.Name.Contains("Mono.WebAssembly.DebuggerProxy");
var isDebuggerFile = e.Name.StartsWith("Mono.Cecil")
|| e.Name.Contains("Mono.WebAssembly.DebuggerProxy")
|| e.Name.Contains("BrowserDebugProxy");
if (!enumeratingDebuggerFiles && isDebuggerFile)
{
@ -150,6 +152,7 @@ namespace Uno.Wasm.Bootstrap.Cli.Server
{
var result = new FileExtensionContentTypeProvider();
result.Mappings.Add(".clr", MediaTypeNames.Application.Octet);
result.Mappings.Add(".dat", MediaTypeNames.Application.Octet);
// result.Mappings.Add(".wasm", "application/wasm");
if (enableDebugging)

Просмотреть файл

@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<StartupObject>Uno.Wasm.Bootstrap.Cli.Program</StartupObject>
<TargetFrameworks>netcoreapp3.1;net5</TargetFrameworks>
<AssemblyName>dotnet-unowasm</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="microsoft.aspnetcore.spaservices.extensions" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<!--
Explicit references to an arbitrary version of the Mono.WebAssembly.DebuggerProxy assembly, to allow
for the server to compile. The references are marked as public so the binaries are not copied to the output
folder, and the proper assemblies can be loaded from the active mono-wasm version.
-->
<Reference Include="Mono.Cecil">
<HintPath>External\Mono.Cecil.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Mono.WebAssembly.DebuggerProxy" Condition="'$(TargetFramework)'=='netcoreapp3.1'">
<HintPath>External\netcoreapp3.1\Mono.WebAssembly.DebuggerProxy.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="BrowserDebugProxy" Condition="'$(TargetFramework)'=='net5'">
<HintPath>External\net5\BrowserDebugProxy.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<Target Name="GetTargetPath" />
</Project>

Просмотреть файл

@ -1,35 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<StartupObject>Uno.Wasm.Bootstrap.Cli.Program</StartupObject>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>dotnet-unowasm</AssemblyName>
<PropertyGroup>
<OutputType>Exe</OutputType>
<StartupObject>Uno.Wasm.Bootstrap.Cli.Program</StartupObject>
<TargetFrameworks>netcoreapp3.1;net5</TargetFrameworks>
<AssemblyName>dotnet-unowasm</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="microsoft.aspnetcore.spaservices.extensions" Version="2.2.0" />
</ItemGroup>
<PackageReference Include="microsoft.aspnetcore.spaservices.extensions" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<!--
<!--
Explicit references to an arbitrary version of the Mono.WebAssembly.DebuggerProxy assembly, to allow
for the server to compile. The references are marked as public so the binaries are not copied to the output
folder, and the proper assemblies can be loaded from the active mono-wasm version.
-->
<Reference Include="Mono.Cecil">
<HintPath>External\Mono.Cecil.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Mono.WebAssembly.DebuggerProxy">
<HintPath>External\Mono.WebAssembly.DebuggerProxy.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
</Project>
<Reference Include="Mono.Cecil">
<HintPath>External\Mono.Cecil.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Mono.WebAssembly.DebuggerProxy" Condition="'$(TargetFramework)'=='netcoreapp3.1'">
<HintPath>External\netcoreapp3.1\Mono.WebAssembly.DebuggerProxy.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="BrowserDebugProxy" Condition="'$(TargetFramework)'=='net5'">
<HintPath>External\net5\BrowserDebugProxy.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<Target Name="GetTargetPath" />
<Target Name="GetCopyToPublishDirectoryItems" />
</Project>

Просмотреть файл

@ -23,8 +23,12 @@
<PackagePath>build</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Uno.Wasm.Bootstrap.Cli\bin\$(Configuration)\netcoreapp3.1\*.*" Link="tools\server\%(FileName)%(Extension)">
<PackagePath>tools\server</PackagePath>
<Content Include="..\Uno.Wasm.Bootstrap.Cli\bin\$(Configuration)\netcoreapp3.1\*.*" Link="tools\server\netcoreapp3.1\%(FileName)%(Extension)">
<PackagePath>tools\server\netcoreapp3.1</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Uno.Wasm.Bootstrap.Cli\bin\$(Configuration)\net5\*.*" Link="tools\server\net5\%(FileName)%(Extension)">
<PackagePath>tools\server\net5</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>

Просмотреть файл

@ -7,9 +7,12 @@
<!-- Nuget deployed run parameters -->
<_unoBinArgs>unowasm serve</_unoBinArgs>
<_UnoDevServerBasePath Condition="'$(TargetFramework)'=='netstandard2.0'">netcoreapp3.1</_UnoDevServerBasePath>
<_UnoDevServerBasePath Condition="'$(TargetFramework.substring(0,3))'=='net' and '$(TargetFramework)'!='netstandard2.0'">net5</_UnoDevServerBasePath>
<!-- Uno.Wasm.Bootstrap internal args -->
<_unoBinArgs Condition="exists('$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli')">exec &quot;$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli/bin/$(Configuration)/netcoreapp3.1/dotnet-unowasm.dll&quot; serve $(_unoRunArgs)</_unoBinArgs>
<_unoBinArgs Condition="!exists('$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli')">&quot;$(MSBuildThisFileDirectory)../tools/server/dotnet-unowasm.dll&quot; serve $(_unoRunArgs)</_unoBinArgs>
<_unoBinArgs Condition="exists('$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli')">exec &quot;$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli/bin/$(Configuration)/$(_UnoDevServerBasePath)/dotnet-unowasm.dll&quot; serve $(_unoRunArgs)</_unoBinArgs>
<_unoBinArgs Condition="!exists('$(MSBuildThisFileDirectory)../../Uno.Wasm.Bootstrap.Cli')">&quot;$(MSBuildThisFileDirectory)../tools/server/$(_UnoDevServerBasePath)/dotnet-unowasm.dll&quot; serve $(_unoRunArgs)</_unoBinArgs>
<RunArguments>$(_unoBinArgs) $(_unoRunArgs) --pathbase &quot;$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\dist&quot; --configuration $(Configuration) --targetframework $(TargetFramework) $(AdditionalRunArguments)</RunArguments>
</PropertyGroup>

Просмотреть файл

@ -62,6 +62,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.WasmSample.WithSpace.Ao
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.StaticLinking.Interpreter", "Uno.Wasm.StaticLinking.Interpreter\Uno.Wasm.StaticLinking.Interpreter.csproj", "{9FFF339E-BD09-4D1C-A756-92AE3625EAFD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.SampleNet5", "Uno.Wasm.SampleNet5\Uno.Wasm.SampleNet5.csproj", "{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.SampleNet5.Aot", "Uno.Wasm.SampleNet5.Aot\Uno.Wasm.SampleNet5.Aot.csproj", "{390B1E51-6A66-4EFE-B794-6DEB65F4CD82}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.Profiler", "Uno.Wasm.Profiler\Uno.Wasm.Profiler.csproj", "{435054BA-2B64-4E17-86F3-7D18F629FE80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -160,6 +166,18 @@ Global
{9FFF339E-BD09-4D1C-A756-92AE3625EAFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FFF339E-BD09-4D1C-A756-92AE3625EAFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FFF339E-BD09-4D1C-A756-92AE3625EAFD}.Release|Any CPU.Build.0 = Release|Any CPU
{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9}.Release|Any CPU.Build.0 = Release|Any CPU
{390B1E51-6A66-4EFE-B794-6DEB65F4CD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{390B1E51-6A66-4EFE-B794-6DEB65F4CD82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{390B1E51-6A66-4EFE-B794-6DEB65F4CD82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{390B1E51-6A66-4EFE-B794-6DEB65F4CD82}.Release|Any CPU.Build.0 = Release|Any CPU
{435054BA-2B64-4E17-86F3-7D18F629FE80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{435054BA-2B64-4E17-86F3-7D18F629FE80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{435054BA-2B64-4E17-86F3-7D18F629FE80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{435054BA-2B64-4E17-86F3-7D18F629FE80}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -184,6 +202,8 @@ Global
{EBCB3142-593E-4815-915D-3B88B75161C1} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
{359A63C4-C5D0-4011-8C39-89D23190B22F} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
{9FFF339E-BD09-4D1C-A756-92AE3625EAFD} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
{B79F67E0-AC18-4B93-A3DD-F1BFE6F418E9} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
{390B1E51-6A66-4EFE-B794-6DEB65F4CD82} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FA350FE9-9316-4846-8145-356F9A0ACBC7}

Просмотреть файл

@ -10,6 +10,8 @@ namespace Uno.Wasm.Bootstrap
public const string DefaultSdkUrl = @"https://unowasmbootstrap.azureedge.net/runtime/mono-wasm-35c322c0198.zip";
public const string DefaultAotSDKUrl = @"https://unowasmbootstrap.azureedge.net/runtime/wasm-release-Linux-35c322c0198f9ad2a0cc1c63e5612ad22af0ecd9.zip";
public const string DefaultMonoVMSdkUrl = "https://unowasmbootstrap.azureedge.net/runtime/dotnet-runtime-wasm-7043528-21442-Release.zip";
/// <summary>
/// Min version of the emscripten SDK. Must be aligned with mono's SDK build in <see cref="DefaultAotSDKUrl"/>.
/// </summary>

Просмотреть файл

@ -244,6 +244,11 @@ class Driver {
}
static void Import (string ra, AssemblyKind kind) {
if(ra == null)
{
return;
}
if (!asm_map.Add (Path.GetFullPath (ra)))
return;
ReaderParameters rp = new ReaderParameters();
@ -295,7 +300,14 @@ class Driver {
Import (resolved.MainModule.FileName, parent_kind);
} else {
var resolve = Resolve (ar.Name, out kind);
Import(resolve, kind);
if (resolve != null)
{
Import(resolve, kind);
}
else
{
Console.WriteLine($"Coukd not resolve {ar.Name}");
}
}
}
}
@ -654,15 +666,16 @@ class Driver {
}
string bcl_root = Path.Combine (sdkdir, "wasm-bcl");
var bcl_prefix = Path.Combine (bcl_root, "wasm");
bcl_tools_prefix = Path.Combine (bcl_root, "wasm_tools");
bcl_facades_prefix = Path.Combine (bcl_prefix, "Facades");
bcl_prefixes = new List<string> ();
if (is_netcore) {
bcl_tools_prefix = Path.Combine (sdkdir, "tools");
/* corelib */
bcl_prefixes.Add (Path.Combine (runtimepack_dir, "native"));
/* .net runtime */
bcl_prefixes.Add (Path.Combine (runtimepack_dir, "lib", "net5.0"));
bcl_prefixes.Add (Path.Combine (runtimepack_dir, "lib", "net6.0"));
} else {
bcl_tools_prefix = Path.Combine (bcl_root, "wasm_tools");
bcl_prefixes.Add (bcl_prefix);
}
@ -736,6 +749,8 @@ class Driver {
if (vfs_prefix.EndsWith ("/"))
vfs_prefix = vfs_prefix.Substring (0, vfs_prefix.Length - 1);
string src_prefix = is_netcore ? Path.Combine(runtimepack_dir, "native") : Path.Combine(tool_prefix, "src");
// wasm core bindings module
var wasm_core_bindings = string.Empty;
if (add_binding) {
@ -745,8 +760,13 @@ class Driver {
var wasm_core_support = string.Empty;
var wasm_core_support_library = string.Empty;
if (add_binding) {
wasm_core_support = BINDINGS_MODULE_SUPPORT;
wasm_core_support_library = $"--js-library {BINDINGS_MODULE_SUPPORT}";
wasm_core_support = $"{src_prefix}/binding_support.js";
wasm_core_support_library = $"--js-library {src_prefix}/binding_support.js ";
if (is_netcore)
{
wasm_core_support_library += $"--js-library {src_prefix}/pal_random.js ";
}
}
var runtime_js = Path.Combine (emit_ninja ? builddir : out_prefix, "runtime.js");
if (emit_ninja) {
@ -781,16 +801,9 @@ class Driver {
file_list.Add ("aot-instances.dll");
}
var file_list_str = string.Join (",", file_list.Select (f => $"\"{Path.GetFileName (f)}\"").Distinct());
var config = String.Format ("config = {{\n \tvfs_prefix: \"{0}\",\n \tdeploy_prefix: \"{1}\",\n \tenable_debugging: {2},\n \tfile_list: [ {3} ],\n", vfs_prefix, deploy_prefix, enable_debug ? "1" : "0", file_list_str);
config += "}\n";
var config_js = Path.Combine (emit_ninja ? builddir : out_prefix, "mono-config.js");
File.Delete (config_js);
File.WriteAllText (config_js, config);
string wasm_runtime_dir;
if (is_netcore) {
wasm_runtime_dir = Path.Combine (runtimepack_dir, "native", "wasm", "runtimes", use_release_runtime ? "release" : "debug");
wasm_runtime_dir = Path.Combine (runtimepack_dir, "native");
} else {
if (wasm_runtime_path == null)
wasm_runtime_path = Path.Combine (tool_prefix, "builds");
@ -802,6 +815,33 @@ class Driver {
else
wasm_runtime_dir = Path.Combine (wasm_runtime_path, use_release_runtime ? "release" : "debug");
}
if (is_netcore)
{
if (!enable_aot)
{
foreach (var icudat in Directory.EnumerateFiles(wasm_runtime_dir))
{
if (Path.GetFileName(icudat).StartsWith("icudt"))
{
file_list.Add(icudat);
}
}
}
else
{
// ICU fails when running with AOT, reason yet unknown
Console.WriteLine("WARNING: ICU Disabled when using AOT");
}
}
var file_list_str = string.Join(",", file_list.Select(f => $"\"{Path.GetFileName(f)}\"").Distinct());
var config = String.Format("config = {{\n \tvfs_prefix: \"{0}\",\n \tdeploy_prefix: \"{1}\",\n \tenable_debugging: {2},\n \tfile_list: [ {3} ],\n", vfs_prefix, deploy_prefix, enable_debug ? "1" : "0", file_list_str);
config += "}\n";
var config_js = Path.Combine(emit_ninja ? builddir : out_prefix, "mono-config.js");
File.Delete(config_js);
File.WriteAllText(config_js, config);
if (!emit_ninja) {
var interp_files = new List<string> { "dotnet.js", "dotnet.wasm" };
if (enable_threads) {
@ -871,15 +911,27 @@ class Driver {
}
runtime_libs += $"$runtime_libdir/libmonosgen-2.0.a ";
if (is_netcore)
runtime_libs += $"$runtime_libdir/libSystem.Native.a";
{
runtime_libs += $"$runtime_libdir/libSystem.Native.a ";
runtime_libs += $"$runtime_libdir/libSystem.IO.Compression.Native.a ";
runtime_libs += $"$runtime_libdir/libicuuc.a ";
runtime_libs += $"$runtime_libdir/libicui18n.a ";
}
else
runtime_libs += $"$runtime_libdir/libmono-native.a";
runtime_libs += $"$runtime_libdir/libmono-native.a ";
string aot_args = "llvm-path=\"$emscripten_sdkdir/upstream/bin\",";
string profiler_libs = "";
string profiler_aot_args = "";
foreach (var profiler in profilers) {
profiler_libs += $"$runtime_libdir/libmono-profiler-{profiler}-static.a ";
if (is_netcore)
{
profiler_libs += $"$runtime_libdir/libmono-profiler-{profiler}.a ";
}
else
{
profiler_libs += $"$runtime_libdir/libmono-profiler-{profiler}-static.a ";
}
if (profiler_aot_args != "")
profiler_aot_args += " ";
profiler_aot_args += $"--profile={profiler}";
@ -928,6 +980,9 @@ class Driver {
aot_args += "mattr=simd,";
emcc_flags += "-s SIMD=1 ";
}
if (is_netcore) {
emcc_flags += $"-DGEN_PINVOKE -I{src_prefix} ";
}
if (!use_release_runtime)
// -s ASSERTIONS=2 is very slow
emcc_flags += "-s ASSERTIONS=1 ";
@ -969,7 +1024,7 @@ class Driver {
ninja.WriteLine ("cross = $mono_sdkdir/wasm-cross-release/bin/wasm32-unknown-none-mono-sgen");
ninja.WriteLine ("emcc = source $emsdk_env && PYTHONUTF8=1 LC_ALL=C.UTF-8 emcc");
ninja.WriteLine ("wasm_opt = $emscripten_sdkdir/upstream/bin/wasm-opt");
ninja.WriteLine ($"emcc_flags = -Oz -g {emcc_flags}-s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_TABLE_GROWTH=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=134217728 -s NO_EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s \\\"EXTRA_EXPORTED_RUNTIME_METHODS=[\'ccall\', \'cwrap\', \'setValue\', \'getValue\', \'UTF8ToString\', \'addFunction\']\\\" -s \\\"EXPORTED_FUNCTIONS=[\'___cxa_is_pointer_type\', \'___cxa_can_catch\']\\\" -s \\\"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[\'setThrew\', \'memset\']\\\"");
ninja.WriteLine ($"emcc_flags = -Oz -g {emcc_flags}-s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_TABLE_GROWTH=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=134217728 -s NO_EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s \\\"EXTRA_EXPORTED_RUNTIME_METHODS=[\'ccall\', \'cwrap\', \'setValue\', \'getValue\', \'UTF8ToString\', \'addFunction\']\\\" -s \\\"EXPORTED_FUNCTIONS=[\'___cxa_is_pointer_type\', \'___cxa_can_catch\']\\\" -s \\\"DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[\'memset\']\\\"");
ninja.WriteLine ($"aot_base_args = llvmonly,asmonly,no-opt,static,direct-icalls,deterministic,{aot_args}");
// Rules
@ -994,10 +1049,15 @@ class Driver {
ninja.WriteLine (" command = bash -c \"$emcc $emcc_flags $flags -c -o $out $in\"");
ninja.WriteLine (" description = [EMCC] $in -> $out");
ninja.WriteLine ("rule emcc-link");
ninja.WriteLine ($" command = bash -c \"$emcc $emcc_flags {emcc_link_flags} -o \\\"$out_js\\\" --js-library $tool_prefix/src/library_mono.js --js-library $tool_prefix/src/dotnet_support.js {wasm_core_support_library} $in\" {strip_cmd}");
ninja.WriteLine ($" command = bash -c \"$emcc $emcc_flags {emcc_link_flags} -o \\\"$out_js\\\" --js-library {src_prefix}/library_mono.js --js-library {src_prefix}/dotnet_support.js {wasm_core_support_library} $in\" {strip_cmd}");
ninja.WriteLine (" description = [EMCC-LINK] $in -> $out_js");
ninja.WriteLine ("rule linker");
ninja.WriteLine (" command = mono $tools_dir/monolinker.exe -out $builddir/linker-out -l none --deterministic --disable-opt unreachablebodies --exclude-feature com,remoting,etw $linker_args || exit 1; mono $tools_dir/wasm-tuner.exe --gen-empty-assemblies $out");
var linkerBin = is_netcore ? "dotnet $tools_dir/illink.dll" : "mono $tools_dir/monolinker.exe";
var linkerSearchPaths = string.Join(" ", root_search_paths.Concat(bcl_prefixes).Distinct().Select(p => $"-d \"{p}\" "));
var linkerOptions = is_netcore ? $"{linkerSearchPaths}" : "-l none --exclude-feature com,remoting,etw";
ninja.WriteLine ($" command = {linkerBin} -out $builddir/linker-out --deterministic --disable-opt unreachablebodies {linkerOptions} $linker_args || exit 1; mono $tools_dir/wasm-tuner.exe --gen-empty-assemblies $out");
ninja.WriteLine (" description = [IL-LINK]");
ninja.WriteLine ("rule aot-instances-dll");
ninja.WriteLine (" command = echo > aot-instances.cs; csc /deterministic /out:$out /target:library aot-instances.cs");
@ -1017,12 +1077,6 @@ class Driver {
ninja.WriteLine ("build $appdir/runtime.js: cpifdiff $builddir/runtime.js");
ninja.WriteLine ("build $appdir/mono-config.js: cpifdiff $builddir/mono-config.js");
if (build_wasm) {
string src_prefix;
if (is_netcore)
src_prefix = Path.Combine (runtimepack_dir, "native", "wasm", "src");
else
src_prefix = Path.Combine (tool_prefix, "src");
var source_file = Path.GetFullPath (Path.Combine (src_prefix, "driver.c"));
ninja.WriteLine ($"build $builddir/driver.c: cpifdiff {source_file}");
ninja.WriteLine ($"build $builddir/driver-gen.c: cpifdiff $builddir/driver-gen.c.in");
@ -1031,10 +1085,13 @@ class Driver {
source_file = Path.GetFullPath (Path.Combine (src_prefix, "pinvoke.h"));
ninja.WriteLine ($"build $builddir/pinvoke.h: cpifdiff {source_file}");
var pinvoke_file_name = is_netcore ? "pinvoke-table.h" : "pinvoke-tables-default.h";
var pinvoke_file = Path.GetFullPath (Path.Combine (src_prefix, pinvoke_file_name));
ninja.WriteLine ($"build $builddir/pinvoke-tables-default.h: cpifdiff {pinvoke_file}");
driver_deps += $" $builddir/pinvoke-tables-default.h";
if (!is_netcore)
{
var pinvoke_file_name = is_netcore ? "pinvoke-table.h" : "pinvoke-tables-default.h";
var pinvoke_file = Path.GetFullPath(Path.Combine(src_prefix, pinvoke_file_name));
ninja.WriteLine($"build $builddir/pinvoke-tables-default.h: cpifdiff {pinvoke_file}");
driver_deps += $" $builddir/pinvoke-tables-default.h";
}
var driver_cflags = enable_aot ? "-DENABLE_AOT=1" : "";
@ -1074,8 +1131,17 @@ class Driver {
if (enable_aot)
ninja.WriteLine ("build $builddir/aot-in: mkdir");
{
foreach (var file in new string[] { "linker-subs.xml", "linker-disable-collation.xml", "linker-preserves.xml" }) {
var source_file = Path.GetFullPath (Path.Combine (tool_prefix, "src", file));
var list = new List<string>();
if (!is_netcore)
{
list.Add("linker-preserves.xml");
list.Add("linker-subs.xml");
list.Add("linker-disable-collation.xml");
}
foreach (var file in list) {
var source_file = Path.GetFullPath (Path.Combine (src_prefix, file));
ninja.WriteLine ($"build $builddir/{file}: cpifdiff {source_file}");
}
}
@ -1212,7 +1278,7 @@ class Driver {
}
if (build_wasm) {
string zlibhelper = enable_zlib ? "$builddir/zlib-helper.o" : "";
ninja.WriteLine ($"build $appdir/dotnet.js $appdir/dotnet.wasm: emcc-link $builddir/driver.o $builddir/pinvoke.o {zlibhelper} {wasm_core_bindings} {ofiles} {profiler_libs} {extra_link_libs} {runtime_libs} | $tool_prefix/src/library_mono.js $tool_prefix/src/dotnet_support.js {wasm_core_support} $emsdk_env");
ninja.WriteLine ($"build $appdir/dotnet.js $appdir/dotnet.wasm: emcc-link $builddir/driver.o $builddir/pinvoke.o {zlibhelper} {wasm_core_bindings} {ofiles} {profiler_libs} {extra_link_libs} {runtime_libs} | {src_prefix}/library_mono.js {src_prefix}/dotnet_support.js {wasm_core_support} $emsdk_env");
ninja.WriteLine (" out_js=$appdir/dotnet.js");
ninja.WriteLine (" out_wasm=$appdir/dotnet.wasm");
}
@ -1237,13 +1303,19 @@ class Driver {
// Only used by the AOT compiler
linker_args += "--explicit-reflection ";
linker_args += "--used-attrs-only true ";
linker_args += "--substitutions linker-subs.xml ";
linker_infiles += "| linker-subs.xml ";
linker_args += "-x linker-preserves.xml ";
linker_infiles += "linker-preserves.xml ";
if (opts.LinkerExcludeDeserialization)
if (!is_netcore)
{
linker_args += "--substitutions linker-subs.xml ";
linker_infiles += "| linker-subs.xml ";
linker_args += "-x linker-preserves.xml ";
linker_infiles += "linker-preserves.xml ";
}
if (opts.LinkerExcludeDeserialization && !is_netcore)
linker_args += "--exclude-feature deserialization ";
if (!opts.EnableCollation) {
if (!opts.EnableCollation && !is_netcore) {
linker_args += "--substitutions linker-disable-collation.xml ";
linker_infiles += "linker-disable-collation.xml";
}

Просмотреть файл

@ -105,6 +105,8 @@ namespace Uno.Wasm.Bootstrap
public string TargetFramework { get; set; } = "";
public string TargetFrameworkVersion { get; set; } = "0.0";
[Microsoft.Build.Framework.Required]
public string IndexHtmlPath { get; set; } = "";
@ -170,21 +172,28 @@ namespace Uno.Wasm.Bootstrap
[Output]
public string? OutputDistPath { get; private set; }
private Version ActualTargetFrameworkVersion => Version.TryParse(TargetFrameworkVersion.Substring(1), out var v) ? v : new Version("0.0");
public override bool Execute()
{
try
{
if (TargetFrameworkIdentifier != ".NETStandard" && TargetFrameworkIdentifier != ".NETCoreApp")
{
Log.LogWarning($"The package Uno.Wasm.Bootstrap is not supported for the current project ({Assembly}), skipping dist generation.");
return true;
}
//if (TargetFrameworkIdentifier != ".NETStandard" && TargetFrameworkIdentifier != ".NETCoreApp")
//{
// Log.LogWarning($"The package Uno.Wasm.Bootstrap is not supported for the current project ({Assembly}), skipping dist generation.");
// return true;
//}
if (string.IsNullOrEmpty(TargetFramework))
{
throw new InvalidOperationException($"The TargetFramework task parameter must be defined.");
}
if(TargetFrameworkIdentifier == ".NETCoreApp" && ActualTargetFrameworkVersion < new Version("5.0"))
{
throw new InvalidOperationException($"The TargetFramework version must be above 5.0 (found {TargetFrameworkVersion})");
}
// Debugger.Launch();
PreloadAssemblies();
@ -215,6 +224,9 @@ namespace Uno.Wasm.Bootstrap
}
}
private bool IsNetCoreWasm =>
TargetFrameworkIdentifier == ".NETCoreApp" && ActualTargetFrameworkVersion >= new Version("5.0");
private void PreloadAssemblies()
{
// Under some circumstances, the assemblies bundled with the bootstrapper do not
@ -434,28 +446,49 @@ namespace Uno.Wasm.Bootstrap
if (IsWSLRequired && !ForceDisableWSL)
{
var unixPath = AlignPath(executable, escape: true);
var monoPath = executable.EndsWith(".exe") ? "mono" : "";
var dotnetRuntimePath = Path.GetExtension(executable).ToLowerInvariant()
switch {
".exe" => "mono",
".dll" => "dotnet",
_ => ""
};
var cwd = workingDirectory != null ? $"cd \\\"{AlignPath(workingDirectory, escape: true)}\\\" && " : "";
parameters = $"-c \" {cwd} {monoPath} {unixPath} " + parameters.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
parameters = $"-c \" {cwd} {dotnetRuntimePath} {unixPath} " + parameters.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
executable = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "sysnative", "bash.exe");
if (!File.Exists(executable))
{
throw new InvalidOperationException(
$"WSL is required for this build but could not be found (Searched for [{executable}]). " +
$"WSL use may be explicitly disabled for CI Windows builds, see more details here: XXXXXXXXXXXXXXXXXX");
$"WSL use may be explicitly disabled for CI Windows builds, see more details here: https://github.com/unoplatform/Uno.Wasm.Bootstrap#special-considerations-for-ci-servers-github-actions-azure-devops");
}
}
else if (RuntimeHelpers.IsNetCore
&& (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
)
&& executable.EndsWith(".exe")
)
{
parameters = $"{executable} {parameters}";
executable = "mono";
if (executable.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{
parameters = $"{executable} {parameters}";
executable = "mono";
}
if (executable.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
{
parameters = $"{executable} {parameters}";
executable = "dotnet";
}
}
else
{
if (executable.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
{
parameters = $"{executable} {parameters}";
executable = "dotnet";
}
}
var p = new Process
@ -538,7 +571,11 @@ namespace Uno.Wasm.Bootstrap
DirectoryCreateDirectory(debuggerLocalPath);
var sourceBasePath = FixupPath(string.IsNullOrEmpty(CustomDebuggerPath) ? Path.Combine(MonoWasmSDKPath, "dbg-proxy", "netcoreapp3.0") : CustomDebuggerPath!);
var proxyBasePath = IsNetCoreWasm
? Path.Combine(MonoWasmSDKPath, "dbg-proxy", "net5", "Release")
: Path.Combine(MonoWasmSDKPath, "dbg-proxy", "netcoreapp3.0");
var sourceBasePath = FixupPath(string.IsNullOrEmpty(CustomDebuggerPath) ? proxyBasePath : CustomDebuggerPath!);
foreach (var debuggerFilePath in Directory.EnumerateFiles(sourceBasePath))
{
@ -578,7 +615,17 @@ namespace Uno.Wasm.Bootstrap
// Timezone support
var releaseTimeZoneData = Path.Combine(BuildTaskBasePath, "..", "tools", "support", "Uno.Wasm.TimezoneData.dll");
referencePathsParameter += $" \"{AlignPath(releaseTimeZoneData)}\"";
if (!IsNetCoreWasm)
{
referencePathsParameter += $" \"{AlignPath(releaseTimeZoneData)}\"";
}
if (GenerateAOTProfile)
{
var profilerSupport = Path.Combine(BuildTaskBasePath, "..", "tools", "support", "Uno.Wasm.Profiler.dll");
referencePathsParameter += $" \"{AlignPath(profilerSupport)}\"";
}
var debugOption = RuntimeDebuggerEnabled ? "--debug" : "";
string packagerBinPath = string.IsNullOrWhiteSpace(PackagerBinPath) ? Path.Combine(MonoWasmSDKPath, "packager.exe") : PackagerBinPath!;
@ -589,10 +636,12 @@ namespace Uno.Wasm.Bootstrap
var emsdkPath = useFullPackager ? ValidateEmscripten() : "";
var monovmparams = IsNetCoreWasm ? $"--framework=net5 --runtimepack-dir={AlignPath(MonoWasmSDKPath)}" : "";
//
// Run the packager to create the original layout. The AOT will optionally run over this pass.
//
var packagerResults = RunProcess(packagerBinPath, $"--runtime-config={RuntimeConfiguration} {appDirParm} --zlib {debugOption} {referencePathsParameter} \"{AlignPath(TryConvertLongPath(Path.GetFullPath(Assembly)))}\"", _workDistPath);
var packagerResults = RunProcess(packagerBinPath, $"--runtime-config={RuntimeConfiguration} {appDirParm} {monovmparams} --zlib {debugOption} {referencePathsParameter} \"{AlignPath(TryConvertLongPath(Path.GetFullPath(Assembly)))}\"", _workDistPath);
if (packagerResults.exitCode != 0)
{
@ -646,6 +695,7 @@ namespace Uno.Wasm.Bootstrap
var extraEmccFlagsPararm = string.Join(" ", extraEmccFlags).Replace("\\", "\\\\");
packagerParams.Add(debugOption);
packagerParams.Add(monovmparams);
packagerParams.Add("--zlib");
packagerParams.Add("--enable-fs ");
packagerParams.Add($"--extra-emccflags=\"{extraEmccFlagsPararm} ");
@ -682,8 +732,6 @@ namespace Uno.Wasm.Bootstrap
" WasmShellForceDisableWSL, the resulting compilation may not run properly.");
}
LinkerSetup();
//
// Run the IL Linker on the interpreter based output, as the packager does not yet do it.
//
@ -691,6 +739,8 @@ namespace Uno.Wasm.Bootstrap
MonoILLinker
)
{
LinkerSetup();
string linkerInput = Path.Combine(IntermediateOutputPath, "linker-in");
if (Directory.Exists(linkerInput))
{
@ -702,23 +752,33 @@ namespace Uno.Wasm.Bootstrap
var assemblyPath = Path.Combine(linkerInput, Path.GetFileName(Assembly));
var frameworkBindings = new[] {
"WebAssembly.Bindings.dll",
"System.Net.Http.WebAssemblyHttpHandler.dll",
"WebAssembly.Net.WebSockets.dll",
};
var frameworkBindings = new List<string>();
if (!IsNetCoreWasm)
{
frameworkBindings.Add("WebAssembly.Bindings.dll");
frameworkBindings.Add("System.Net.Http.WebAssemblyHttpHandler.dll");
frameworkBindings.Add("WebAssembly.Net.WebSockets.dll");
}
var linkerSearchPaths = string.Join(" ", _referencedAssemblies.Select(Path.GetDirectoryName).Distinct().Select(p => $"-d \"{p}\" "));
var fullSDKFolder = IsNetCoreWasm ? $"-d \"{_bclPath}\" {linkerSearchPaths}" : "";
var bindingsPath = string.Join(" ", frameworkBindings.Select(a => $"-a \"{Path.Combine(linkerInput, a)}\""));
bindingsPath += $" -a \"{releaseTimeZoneData}\"";
// Opts should be aligned with the monolinker call in packager.cs, validate for linker_args as well
var packagerLinkerOpts = $"--deterministic --disable-opt unreachablebodies --exclude-feature com --exclude-feature remoting --exclude-feature etw --used-attrs-only true ";
var packagerLinkerOpts = $"--deterministic --disable-opt unreachablebodies --used-attrs-only true ";
if (!IsNetCoreWasm) {
packagerLinkerOpts += "--exclude-feature com --exclude-feature remoting --exclude-feature etw -l none ";
}
var linkerResults = RunProcess(
_linkerBinPath,
$"-out \"{_managedPath}\" --verbose -b true -l none {packagerLinkerOpts} -a \"{assemblyPath}\" {bindingsPath} -c link -p copy \"WebAssembly.Bindings\" -p copy \"Uno.Wasm.TimezoneData\" -d \"{_managedPath}\"",
$"-out \"{_managedPath}\" --verbose -b true {packagerLinkerOpts} -a \"{assemblyPath}\" {bindingsPath} -c link -p copy \"WebAssembly.Bindings\" -p copy \"Uno.Wasm.TimezoneData\" -d \"{_managedPath}\" {fullSDKFolder}",
_managedPath
);
);
if (linkerResults.exitCode != 0)
{
@ -788,7 +848,14 @@ namespace Uno.Wasm.Bootstrap
private void LinkerSetup()
{
_linkerBinPath = CustomLinkerPath ?? Path.Combine(MonoWasmSDKPath, "wasm-bcl", "wasm_tools", "monolinker.exe");
if (IsNetCoreWasm)
{
_linkerBinPath = CustomLinkerPath ?? Path.Combine(MonoWasmSDKPath, "tools", "illink.dll");
}
else
{
_linkerBinPath = CustomLinkerPath ?? Path.Combine(MonoWasmSDKPath, "wasm-bcl", "wasm_tools", "monolinker.exe");
}
var configFilePath = _linkerBinPath + ".config";
if (!File.Exists(configFilePath))
@ -1053,11 +1120,20 @@ namespace Uno.Wasm.Bootstrap
private void GetBcl()
{
_bclPath = Path.Combine(MonoWasmSDKPath, "wasm-bcl", "wasm");
var reals = Directory.GetFiles(_bclPath, "*.dll");
var facades = Directory.GetFiles(Path.Combine(_bclPath, "Facades"), "*.dll");
var allFiles = reals.Concat(facades);
_bclAssemblies = allFiles.ToDictionary(x => Path.GetFileName(x));
if (IsNetCoreWasm)
{
_bclPath = Path.Combine(MonoWasmSDKPath, "runtimes", "browser-wasm", "lib", "net6.0");
var reals = Directory.GetFiles(_bclPath, "*.dll");
_bclAssemblies = reals.ToDictionary(x => Path.GetFileName(x));
}
else
{
_bclPath = Path.Combine(MonoWasmSDKPath, "wasm-bcl", "wasm");
var reals = Directory.GetFiles(_bclPath, "*.dll");
var facades = Directory.GetFiles(Path.Combine(_bclPath, "Facades"), "*.dll");
var allFiles = reals.Concat(facades);
_bclAssemblies = allFiles.ToDictionary(x => Path.GetFileName(x));
}
}
private void CreateDist()
@ -1086,32 +1162,46 @@ namespace Uno.Wasm.Bootstrap
private void CopyRuntime()
{
// Adjust for backward compatibility
RuntimeConfiguration = RuntimeConfiguration == "release-dynamic" ? "dynamic-release" : RuntimeConfiguration;
DirectoryCreateDirectory(_workDistRootPath);
var runtimePath = Path.Combine(MonoWasmSDKPath, "builds", RuntimeConfiguration.ToLower());
foreach (var sourceFile in Directory.EnumerateFiles(runtimePath))
if (IsNetCoreWasm)
{
var dest = Path.Combine(_workDistPath, Path.GetFileName(sourceFile));
var runtimePath = Path.Combine(MonoWasmSDKPath, "runtimes", "browser-wasm", "native");
var matchedExtension = _contentExtensionsToExclude
.FirstOrDefault(x => sourceFile.EndsWith(x, StringComparison.OrdinalIgnoreCase));
if (matchedExtension == null)
foreach (var sourceFile in Directory.EnumerateFiles(runtimePath))
{
var dest = Path.Combine(_workDistPath, Path.GetFileName(sourceFile));
Log.LogMessage($"Runtime: {sourceFile} -> {dest}");
FileCopy(sourceFile, dest, true);
}
else
{
Log.LogMessage($"Runtime: ignoring file {sourceFile} / matched with exclusion extension {matchedExtension}");
}
}
else
{
// Adjust for backward compatibility
RuntimeConfiguration = RuntimeConfiguration == "release-dynamic" ? "dynamic-release" : RuntimeConfiguration;
DirectoryCreateDirectory(_workDistRootPath);
var runtimePath = Path.Combine(MonoWasmSDKPath, "builds", RuntimeConfiguration.ToLower());
FileCopy(Path.Combine(MonoWasmSDKPath, "server.py"), Path.Combine(_workDistRootPath, "server.py"), true);
foreach (var sourceFile in Directory.EnumerateFiles(runtimePath))
{
var dest = Path.Combine(_workDistPath, Path.GetFileName(sourceFile));
var matchedExtension = _contentExtensionsToExclude
.FirstOrDefault(x => sourceFile.EndsWith(x, StringComparison.OrdinalIgnoreCase));
if (matchedExtension == null)
{
Log.LogMessage($"Runtime: {sourceFile} -> {dest}");
FileCopy(sourceFile, dest, true);
}
else
{
Log.LogMessage($"Runtime: ignoring file {sourceFile} / matched with exclusion extension {matchedExtension}");
}
}
FileCopy(Path.Combine(MonoWasmSDKPath, "server.py"), Path.Combine(_workDistRootPath, "server.py"), true);
}
}
private (string fullPath, string relativePath) GetFilePaths(ITaskItem item)
@ -1146,7 +1236,6 @@ namespace Uno.Wasm.Bootstrap
}
}
private void CopyContent()
{
var assets = new List<string>();
@ -1277,9 +1366,24 @@ namespace Uno.Wasm.Bootstrap
_resourceSearchList ??= new List<AssemblyDefinition>(
from asmPath in sourceList.Distinct()
select AssemblyDefinition.ReadAssembly(asmPath)
let asm = ReadAssembly(asmPath)
where asm != null
select asm
);
}
AssemblyDefinition? ReadAssembly(string asmPath)
{
try
{
return AssemblyDefinition.ReadAssembly(asmPath);
}
catch (Exception ex)
{
Log.LogMessage($"Failed to read assembly {ex}");
return null;
}
}
}
private void CopyResourceToOutput(string name, EmbeddedResource resource)

Просмотреть файл

@ -8,7 +8,7 @@
<RootNamespace>Uno.Wasm.Bootstrap.v0</RootNamespace>
<PackageId>Uno.Wasm.Bootstrap</PackageId>
<IsTool>true</IsTool>
<Version>2.0.1-test.3</Version>
<Version>2.0.1-test.8</Version>
<GeneratePackageOnBuild Condition="'$(Configuration)'=='Release'">true</GeneratePackageOnBuild>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
@ -39,6 +39,7 @@
<ItemGroup>
<None Include="images\icon.png" Pack="true" PackagePath="\" />
<None Include="wasm-tuner\wasm-tuner.proj" />
<Content Include="build/*.targets">
<Pack>true</Pack>
<PackagePath>build</PackagePath>
@ -55,6 +56,10 @@
<Pack>true</Pack>
<PackagePath>build/linker</PackagePath>
</Content>
<Content Include="build/cilstrip/**">
<Pack>true</Pack>
<PackagePath>build/cilstrip</PackagePath>
</Content>
<Content Include="build/scripts/**">
<Pack>true</Pack>
<PackagePath>build/scripts</PackagePath>
@ -108,9 +113,11 @@
<ItemGroup>
<!-- This file is built as part of the UnoInstallSDKTask_v0 task -->
<Compile Remove="Packager\*.cs" />
<Compile Remove="wasm-tuner\*.cs" />
<!-- But make it visible in VS -->
<None Include="Packager\*.*" />
<None Include="wasm-tuner\*.*" />
</ItemGroup>
<ItemGroup>
@ -129,17 +136,26 @@
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
<ProjectReference Include="..\Uno.Wasm.Profiler\Uno.Wasm.Profiler.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
</ItemGroup>
<Target Name="UpdateTimezonePack" AfterTargets="CoreCompile">
<Target Name="UpdateAdditionalAssemblies" AfterTargets="CoreCompile">
<ItemGroup>
<Content Include="./tools/support/Uno.Wasm.TimezoneData.*">
<Pack>true</Pack>
<PackagePath>tools/support</PackagePath>
</Content>
<Content Include="./tools/support/Uno.Wasm.Profiler.*">
<Pack>true</Pack>
<PackagePath>tools/support</PackagePath>
</Content>
</ItemGroup>
</Target>
<Target Name="BuildPackager" BeforeTargets="Build">
<PropertyGroup>
<_packagerIntermediatePath>$(IntermediateOutputPath)packager_build/</_packagerIntermediatePath>
@ -164,4 +180,27 @@
</ItemGroup>
</Target>
<Target Name="BuildWasmTuner" BeforeTargets="Build">
<PropertyGroup>
<_wasmTunerIntermediatePath>$(IntermediateOutputPath)wasmtuner_build/</_wasmTunerIntermediatePath>
</PropertyGroup>
<ItemGroup>
<_WasmTunerSource Include="wasm-tuner/*.*" />
</ItemGroup>
<Message Text="Building custom wasm-tuner.exe $(_wasmTunerIntermediatePath)" Importance="high" />
<MakeDir Directories="$(_packagerIntermediatePath)" />
<Copy SourceFiles="@(_WasmTunerSource)" DestinationFolder="$(_wasmTunerIntermediatePath)" />
<Move SourceFiles="$(_wasmTunerIntermediatePath)wasm-tuner.proj" DestinationFiles="$(_wasmTunerIntermediatePath)wasm-tuner.csproj" />
<MSBuild Projects="$(_wasmTunerIntermediatePath)wasm-tuner.csproj" Targets="Restore;Build" Properties="Configuration=$(Configuration)" />
<Copy SourceFiles="$(_wasmTunerIntermediatePath)bin/$(Configuration)/wasm-tuner.exe" DestinationFiles="$(MSBuildThisFileDirectory)build/wasm-tuner/wasm-tuner.exe" />
<!-- Update the item group with generated files -->
<ItemGroup>
<Content Include="build/wasm-tuner/**">
<Pack>true</Pack>
<PackagePath>build/wasm-tuner</PackagePath>
</Content>
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -19,11 +19,26 @@ namespace Uno.Wasm.Bootstrap
public string? MonoWasmAOTSDKUri { get; set; }
public string? NetCoreWasmSDKUri { get; set; }
public string? MonoTempFolder { get; set; }
[Microsoft.Build.Framework.Required]
public string TargetFrameworkIdentifier { get; set; } = "";
public string TargetFramework { get; set; } = "";
public string TargetFrameworkVersion { get; set; } = "0.0";
[Required]
public string PackagerOverrideFolderPath { get; set; } = "";
[Required]
public string WasmTunerOverrideFolderPath { get; set; } = "";
[Required]
public string CilStripOverrideFolderPath { get; set; } = "";
[Required]
public bool IsOSUnixLike { get; set; }
@ -35,23 +50,93 @@ namespace Uno.Wasm.Bootstrap
public bool GenerateAOTProfile { get; set; } = false;
public bool DisableSDKCheckSumValidation { get; set; } = false;
[Output]
public string? SdkPath { get; set; }
[Output]
public string? PackagerBinPath { get; set; }
[Output]
public string? WasmTunerBinPath { get; set; }
[Output]
public string? PackagerProjectFile { get; private set; }
public override bool Execute()
{
InstallSdk();
if (IsNetCore)
{
InstallNetCoreWasmSdk();
}
else
{
InstallMonoSdk();
}
return true;
}
private Version ActualTargetFrameworkVersion => Version.TryParse(TargetFrameworkVersion.Substring(1), out var v) ? v : new Version("0.0");
private void InstallSdk()
private void InstallNetCoreWasmSdk()
{
var sdkUri = string.IsNullOrWhiteSpace(NetCoreWasmSDKUri) ? Constants.DefaultMonoVMSdkUrl : NetCoreWasmSDKUri!;
var sdkName = Path.GetFileNameWithoutExtension(new Uri(sdkUri).AbsolutePath.Replace('/', Path.DirectorySeparatorChar));
Log.LogMessage("NetCore-Wasm SDK: " + sdkName);
SdkPath = Path.Combine(GetMonoTempPath(), sdkName);
Log.LogMessage("NetCore-Wasm SDK Path: " + SdkPath);
var writeChecksum = false;
ValidateSDKCheckSum("NetCore-Wasm", SdkPath);
if (!Directory.Exists(SdkPath))
{
var zipPath = SdkPath + ".zip";
Log.LogMessage($"Using NetCore-Wasm SDK {sdkUri}");
zipPath = RetreiveSDKFile(sdkName, sdkUri, zipPath);
ZipFile.ExtractToDirectory(zipPath, SdkPath);
Log.LogMessage($"Extracted {sdkName} to {SdkPath}");
MarkSDKExecutable();
writeChecksum = true;
}
WritePackager();
WriteWasmTuner();
WriteCilStrip();
if (writeChecksum)
{
WriteChecksum(SdkPath);
Log.LogMessage($"Wrote checksum to {SdkPath}");
}
}
private void ValidateSDKCheckSum(string sdkName, string sdkPath)
{
if (!DisableSDKCheckSumValidation && Directory.Exists(sdkPath) && !VerifyChecksum(sdkPath))
{
// SDK folder was tampered with (e.g. StorageSense, User, etc.)
Log.LogMessage($"Removing invalid {sdkName} SDK: {sdkPath}");
var destination = $"{sdkPath}.{Guid.NewGuid():N}";
Directory.Move(sdkPath, destination);
Directory.Delete(destination, true);
}
}
private bool IsNetCore =>
TargetFrameworkIdentifier == ".NETCoreApp" && ActualTargetFrameworkVersion >= new Version("5.0");
private void InstallMonoSdk()
{
var runtimeExecutionMode = ParseRuntimeExecutionMode();
@ -77,17 +162,7 @@ namespace Uno.Wasm.Bootstrap
var writeChecksum = false;
if (Directory.Exists(SdkPath) && !VerifyChecksum(SdkPath))
{
// SDK folder was tampered with (e.g. StorageSense, User, etc.)
Log.LogMessage($"Removing invalid mono-wasm SDK: {SdkPath}");
var destination = $"{SdkPath}.{Guid.NewGuid():N}";
Directory.Move(SdkPath, destination);
Directory.Delete(destination, true);
}
ValidateSDKCheckSum("mono-wasm", SdkPath);
if (!Directory.Exists(SdkPath))
{
@ -122,26 +197,12 @@ namespace Uno.Wasm.Bootstrap
}
Log.LogMessage($"Extracted AOT {sdkName} to {SdkPath}");
if (IsOSUnixLike)
{
Process.Start("chmod", $"-R +x {SdkPath}");
}
MarkSDKExecutable();
writeChecksum = true;
}
if (!string.IsNullOrEmpty(PackagerOverrideFolderPath))
{
PackagerBinPath = Path.Combine(SdkPath, "packager2.exe");
foreach (var file in Directory.EnumerateFiles(PackagerOverrideFolderPath))
{
var destFileName = Path.Combine(SdkPath, Path.GetFileName(file));
Log.LogMessage($"Copy packager override {file} to {destFileName}");
File.Copy(file, destFileName, true);
}
}
WritePackager();
if (writeChecksum)
{
@ -155,6 +216,60 @@ namespace Uno.Wasm.Bootstrap
}
}
private void MarkSDKExecutable()
{
if (IsOSUnixLike)
{
Process.Start("chmod", $"-R +x {SdkPath}");
}
}
private void WritePackager()
{
if (!string.IsNullOrEmpty(PackagerOverrideFolderPath))
{
PackagerBinPath = Path.Combine(SdkPath, "packager2.exe");
foreach (var file in Directory.EnumerateFiles(PackagerOverrideFolderPath))
{
var destFileName = Path.Combine(SdkPath, Path.GetFileName(file));
Log.LogMessage($"Copy packager override {file} to {destFileName}");
File.Copy(file, destFileName, true);
}
}
}
private void WriteWasmTuner()
{
if (!string.IsNullOrEmpty(WasmTunerOverrideFolderPath))
{
var basePath = Path.Combine(SdkPath, "tools");
Directory.CreateDirectory(basePath);
foreach (var file in Directory.EnumerateFiles(WasmTunerOverrideFolderPath))
{
var destFileName = Path.Combine(basePath, Path.GetFileName(file));
Log.LogMessage($"Copy wasm-tuner {file} to {destFileName}");
File.Copy(file, destFileName, true);
}
}
}
private void WriteCilStrip()
{
if (!string.IsNullOrEmpty(CilStripOverrideFolderPath))
{
var basePath = Path.Combine(SdkPath, "tools");
Directory.CreateDirectory(basePath);
foreach (var file in Directory.EnumerateFiles(CilStripOverrideFolderPath))
{
var destFileName = Path.Combine(basePath, Path.GetFileName(file));
Log.LogMessage($"Copy cil-strip {file} to {destFileName}");
File.Copy(file, destFileName, true);
}
}
}
static readonly string[] BitCodeExtensions = new string[] { ".bc", ".a" };
private bool HasBitcodeAssets()

Просмотреть файл

@ -15,7 +15,10 @@ var Module = {
}
if (config.generate_aot_profile) {
MONO.mono_wasm_init_aot_profiler(null);
MONO.mono_wasm_init_aot_profiler({
write_at: "Uno.ProfilerSupport::StopProfile",
send_to: "Uno.ProfilerSupport::DumpAotProfileData"
});
}
MONO.mono_load_runtime_and_bcl(
@ -24,6 +27,14 @@ var Module = {
config.enable_debugging,
config.file_list,
function () {
if (config.generate_aot_profile) {
var initializeProfile = Module.mono_bind_static_method("[Uno.Wasm.Profiler] Uno.ProfilerSupport:Initialize");
if (initializeProfile) {
initializeProfile();
}
}
App.init();
},
config.fetch_file_cb
@ -167,7 +178,7 @@ var App = {
App.attachProfilerHotKey();
MonoRuntime.init();
BINDING.bindings_lazy_init();
App.timezoneSetup();
// App.timezoneSetup();
var mainMethod = BINDING.resolve_method_fqn(config.uno_main);
@ -375,6 +386,10 @@ var App = {
asset = asset.replace(".dll", `.${config.assemblyFileExtension}`);
}
if (asset.startsWith("icudt") && asset.endsWith(".dat")) {
asset = `${config.uno_app_base}/${asset}`;
}
asset = asset.replace("/managed/", `/${config.uno_remote_managedpath}/`);
if (ENVIRONMENT_IS_NODE) {
@ -409,9 +424,8 @@ var App = {
.fetchWithProgress(asset, (loaded, adding) => this.reportAssemblyLoading(adding));
}
}
else {
return fetch(asset);
}
return fetch(asset);
}
},
@ -551,7 +565,7 @@ var App = {
},
saveProfile: function () {
var stopProfile = Module.mono_bind_static_method("[WebAssembly.Bindings] WebAssembly.Runtime:StopProfile");
var stopProfile = Module.mono_bind_static_method("[Uno.Wasm.Profiler] Uno.ProfilerSupport:StopProfile");
stopProfile();
// Export the file

Просмотреть файл

@ -56,7 +56,15 @@
<!-- Compatibility with previous version of the task using WasmShellEnableAOT -->
<WasmShellMonoRuntimeExecutionMode Condition="'$(WasmShellEnableAOT)'=='true'">FullAOT</WasmShellMonoRuntimeExecutionMode>
<_WasmShellIsNetCore Condition="'$(TargetFramework)'=='net5' or '$(TargetFramework)'=='net6'">true</_WasmShellIsNetCore>
</PropertyGroup>
<ItemGroup Condition="'$(_WasmShellIsNetCore)'=='true'">
<!-- Remove all the AspNetCore references so we can use them in the output -->
<FrameworkReference Remove="Microsoft.AspNetCore.App" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-rc.2.20475.5" />
</ItemGroup>
<ItemGroup>
<!-- Default compressed extensions when WasmShellGenerateCompressedFiles is enabled -->
@ -114,15 +122,22 @@
<UnoInstallSDKTask_v0
MonoWasmSDKUri="$(MonoWasmSDKUri)"
MonoWasmAOTSDKUri="$(MonoWasmAOTSDKUri)"
NetCoreWasmSDKUri="$(NetCoreWasmSDKUri)"
IsOSUnixLike="$([MSBuild]::IsOsUnixLike())"
MonoRuntimeExecutionMode="$(WasmShellMonoRuntimeExecutionMode)"
PackagerOverrideFolderPath="$(MSBuildThisFileDirectory)/packager"
WasmTunerOverrideFolderPath="$(MSBuildThisFileDirectory)/wasm-tuner"
CilStripOverrideFolderPath="$(MSBuildThisFileDirectory)/cilstrip"
DisableSDKCheckSumValidation="$(WasmShellDisableSDKCheckSumValidation)"
MonoTempFolder="$(WasmShellMonoTempFolder)"
GenerateAOTProfile="$(WasmShellGenerateAOTProfile)"
TargetFrameworkIdentifier="$(TargetFrameworkIdentifier)"
TargetFramework="$(TargetFramework)"
TargetFrameworkVersion="$(TargetFrameworkVersion)"
Assets="@(Content)">
<Output TaskParameter="SdkPath" PropertyName="_UnoMonoSdkPath" />
<Output TaskParameter="PackagerBinPath" PropertyName="_UnoMonoPackagerBinPath" />
<Output TaskParameter="PackagerProjectFile" PropertyName="_UnoMonoPackagerProjectFile" />
<Output TaskParameter="PackagerBinPath" PropertyName="_UnoMonoPackagerBinPath" />
<Output TaskParameter="PackagerProjectFile" PropertyName="_UnoMonoPackagerProjectFile" />
</UnoInstallSDKTask_v0>
<ShellTask_v0
@ -134,6 +149,7 @@
IntermediateOutputPath="$(ProjectDir)$(IntermediateOutputPath)"
TargetFrameworkIdentifier="$(TargetFrameworkIdentifier)"
TargetFramework="$(TargetFramework)"
TargetFrameworkVersion="$(TargetFrameworkVersion)"
WasmShellMode="$(WasmShellMode)"
MonoWasmSDKPath="$(_UnoMonoSdkPath)"
PackagerBinPath="$(_UnoMonoPackagerBinPath)"

Просмотреть файл

@ -35,6 +35,7 @@
<Content Include="README.md" />
<Content Include="tsconfig.json" />
</ItemGroup>
<Target Name="Build"/>
<!-- Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them. -->
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" />
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" Condition="Exists('$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets')" />
@ -79,4 +80,4 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>

Просмотреть файл

@ -0,0 +1,3 @@
<linker>
<assembly fullname="Uno.Wasm.Profiler" />
</linker>

Просмотреть файл

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using WebAssembly;
namespace Uno
{
public static class ProfilerSupport
{
public static void Initialize()
=> Console.WriteLine("Profiler support initialized");
//
// Can be called by the app to stop profilings
//
[MethodImpl(MethodImplOptions.NoInlining)]
public static void StopProfile()
{
}
// Called by the AOT profiler to save profile data into Module.aot_profile_data
[MethodImpl(MethodImplOptions.NoInlining)]
public unsafe static void DumpAotProfileData(ref byte buf, int len, string s)
{
fixed (void* p = &buf)
{
Runtime.InvokeJS($"Module.aot_profile_data = Module.HEAPU8.slice({(long)p}, {(long)p} + {len});");
}
}
}
}

Просмотреть файл

@ -0,0 +1,50 @@
using System;
using System.Runtime.CompilerServices;
namespace WebAssembly
{
internal sealed class Runtime
{
/// <summary>
/// Mono specific internal call.
/// </summary>
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern string InvokeJS(string str, out int exceptional_result);
// Disable inlining to avoid the interpreter to evaluate an internal call that may not be available
[MethodImpl(MethodImplOptions.NoInlining)]
private static string MonoInvokeJS(string str, out int exceptionResult) => InvokeJS(str, out exceptionResult);
// Disable inlining to avoid the interpreter to evaluate an internal call that may not be available
[MethodImpl(MethodImplOptions.NoInlining)]
private static string NetCoreInvokeJS(string str, out int exceptionResult)
=> Interop.Runtime.InvokeJS(str, out exceptionResult);
/// <summary>
/// Invokes Javascript code in the hosting environment
/// </summary>
internal static string InvokeJS(string str)
{
var r = IsNetCore
? NetCoreInvokeJS(str, out var exceptionResult)
: MonoInvokeJS(str, out exceptionResult);
if (exceptionResult != 0)
{
Console.Error.WriteLine($"Error #{exceptionResult} \"{r}\" executing javascript: \"{str}\"");
}
return r;
}
internal static bool IsNetCore { get; } = Type.GetType("System.Runtime.Loader.AssemblyLoadContext") != null;
}
}
internal sealed class Interop
{
internal sealed class Runtime
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern string InvokeJS(string str, out int exceptional_result);
}
}

Просмотреть файл

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<EmbeddedResource Include="LinkerConfig.xml">
<LogicalName>$(AssemblyName).xml</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Target Name="CopyToBoostrapDev" AfterTargets="Build">
<ItemGroup>
<_TimeZoneOutputFiles Include="$(TargetDir)\Uno.Wasm.Profiler.*" />
</ItemGroup>
<Copy SourceFiles="@(_TimeZoneOutputFiles)" DestinationFolder="..\Uno.Wasm.Bootstrap\tools\support" />
</Target>
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,3 @@
<linker>
<assembly fullname="Uno.Wasm.SampleNet5.Aot" />
</linker>

Просмотреть файл

@ -0,0 +1,38 @@
// #define BENCHMARK_ENABLED
using System;
using System.Threading;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Toolchains.InProcess;
using System.IO;
using BenchmarkDotNet.Attributes;
using System.Text.Json;
namespace Uno.Wasm.Sample
{
public static class Program
{
static void Main(string[] args)
{
Console.WriteLine($"RuntimeVersion: {RuntimeInformation.FrameworkDescription}");
Console.WriteLine($"Mono Runtime Mode: " + Environment.GetEnvironmentVariable("UNO_BOOTSTRAP_MONO_RUNTIME_MODE"));
Console.WriteLine($"args: " + args.Length);
var i = 42;
var now = DateTime.Now.ToString();
Console.WriteLine($"Main! {i} {now}");
Run();
}
private static void Run() { }
}
}

Просмотреть файл

@ -0,0 +1,10 @@
using System.Runtime.CompilerServices;
internal sealed class Interop
{
internal sealed class Runtime
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern string InvokeJS(string str, out int exceptional_result);
}
}

Просмотреть файл

@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<StartupObject>Uno.Wasm.Sample.Program</StartupObject>
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling>
<WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>
<!--<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>-->
<WasmShellDisableSDKCheckSumValidation>true</WasmShellDisableSDKCheckSumValidation>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.5-develop.3" />
<PackageReference Include="BenchmarkDotNet.Annotations" Version="0.11.5-develop.3" />
<PackageReference Include="System.Text.Json" Version="5.0.0-rc.2.20475.5" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-rc.2.20475.5" />
</ItemGroup>
<ItemGroup>
<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
<WasmShellMonoEnvironment Include="MONO_LOG_LEVEL" Value="debug" />
<WasmShellMonoEnvironment Include="MONO_LOG_MASK" Value="gc" />
</ItemGroup>
<Import Project="..\Uno.Wasm.Bootstrap\build\Uno.Wasm.Bootstrap.targets" />
<Import Project="..\Uno.Wasm.Bootstrap.DevServer\build\Uno.Wasm.Bootstrap.DevServer.targets" />
<ItemGroup>
<None Include="WasmScripts\**\*.js" />
<None Include="WasmCSS\**\*.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="WasmScripts\**\*.js" />
<EmbeddedResource Include="WasmCSS\**\*.css" />
</ItemGroup>
<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Uno.Wasm.Bootstrap.Cli\Uno.Wasm.Bootstrap.Cli.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
<ProjectReference Include="..\Uno.Wasm.Bootstrap\Uno.Wasm.Bootstrap.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,53 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

Просмотреть файл

@ -0,0 +1,5 @@
var UnoAppManifest = {
splashScreenImage: "https://microsoft.github.io/microsoft-ui-xaml/img/winui-logo.png",
splashScreenColor: "#00f",
accentColor: "#f00",
}

Просмотреть файл

@ -0,0 +1,5 @@
define(() => {
var txt = document.createTextNode("'test' dependency loaded successfully. Open F12 console to see output.");
var parent = document.getElementById('uno-body');
parent.append(txt);
});

Двоичные данные
src/Uno.Wasm.SampleNet5.Aot/wwwroot/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 15 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 33 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 505 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 505 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 13 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.8 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 33 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 120 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 73 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 177 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 72 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 257 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 263 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 184 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 52 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 52 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 70 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 72 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 783 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1016 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 40 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 16 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 26 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 13 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.8 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 19 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше