Skip to content

Commit

Permalink
Merge pull request #884 from unoplatform/dev/jela/net9
Browse files Browse the repository at this point in the history
.NET 9 Support
  • Loading branch information
jeromelaban authored Sep 13, 2024
2 parents 1153f5c + a25119e commit 9cad02c
Show file tree
Hide file tree
Showing 300 changed files with 27,320 additions and 43,212 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/ci.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/Uno.Wasm.Sample.RayTracer/bin/Release/net6.0/publish/wwwroot
DIST_PATH: src/Uno.Wasm.Sample.RayTracer/bin/Release/net9.0/publish/wwwroot

if: (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
Expand All @@ -38,15 +38,34 @@ jobs:
useConfigFile: true
configFilePath: gitversion.yml

- name: Setup dotnet 8.0.100
# Daily builds install
# - run: |
# wget https://dot.net/v1/dotnet-install.sh
# chmod +x dotnet-install.sh
# ./dotnet-install.sh -c 9.0 -q daily
# echo ~/.dotnet >> $GITHUB_PATH
#
# name: Setup .NET
#

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: '8.0.100'
dotnet-version: '9.0.100-rc.1.24452.12'
include-prerelease: true

- run: |
cd src
dotnet workload install wasm-tools
name: Setup Workloads
- run: |
dotnet build -c Release src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj /bl:./artifacts-logs/build.binlog
name: Build Bootstrap
- run: |
dotnet publish -c Release /p:DISABLE_CLIHOST_NET6=true src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj /bl:./artifacts-logs/build.binlog
dotnet publish -c Release /p:DISABLE_CLIHOST_NET6=true src/Uno.Wasm.Sample.RayTracer/Uno.Wasm.Sample.RayTracer.csproj /bl:./artifacts-logs/build-sample.binlog
dotnet publish -c Release src/Uno.Wasm.Sample.RayTracer/Uno.Wasm.Sample.RayTracer.csproj /bl:./artifacts-logs/build-sample.binlog
name: Build WebAssembly app
- uses: actions/upload-artifact@v4
Expand All @@ -55,6 +74,7 @@ jobs:
path: ${{ env.DIST_PATH }}

- uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: artifacts-logs
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,7 @@ launchSettings.json
# Directory Cache files
.DS_Store
thumbs.db
/src/Uno.Wasm.Bootstrap/tools
/src/Uno.Wasm.Bootstrap/build/packager
/src/Uno.Wasm.Bootstrap/build/wasm-tuner

1 change: 0 additions & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ stages:
parameters:
jobName: macOS_Tests
vmImage: macOS-12
- template: build/ci/stage-build-wsl-tests.yml
20 changes: 9 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/unoplatform/Uno.Wasm.Bootstrap)

Uno.Wasm.Bootstrap provides a simple way to package C# .NET code, and run it from a compatible browser environment.
The Uno.Wasm.Bootstrap package provides a runtime bootstrapper of the `Microsoft.NET.Sdk.WebAssembly` SDK from .NET 9.

It is a standalone .NET Web Assembly (Wasm) sdk bootstrapper taking the form of a nuget package.
This package only provides the bootstrapping features to run a .NET assembly and write to the JavaScript console, through `Console.WriteLine`. To write an app that provides UI functionalities, make sur to check out https://aka.platform.uno/get-started.

Installing it on a .NET project (5, 6, 7, 8 or .NET Standard 2.0) with an entry point allows to publish it as part of a Wasm distribution folder, along with CSS, JavaScript and content files.

This package only provides the bootstrapping features to run a .NET assembly and write to the JavaScript console, through `Console.WriteLine`.

This package is based on the excellent work from @praeclarum's [OOui Wasm MSBuild task](https://github.com/praeclarum/Ooui).
This work is based on the excellent work from @praeclarum's [OOui Wasm MSBuild task](https://github.com/praeclarum/Ooui).

## Documentation

Expand All @@ -28,15 +24,11 @@ This package is based on the excellent work from @praeclarum's [OOui Wasm MSBuil
- [Splash screen](doc/features-splash-screen.md)
- [Threading](doc/features-threading.md)
- [Deep linking](doc/features-deep-linking.md)
- [Pre-compression](doc/features-pre-compression.md)
- [Embedded mode](doc/features-embedded.mode.md)
- [Native Linker Optimization](doc/features-linker-opts.md)
- [Memory troubleshooting](doc/features-memory-corruption-troubleshooting.md)
- [Module Linking](doc/features-module-linking.md)
- [Profiling](doc/features-profiling.md)
- [Node JS](doc/features-node-js.md)
- [Nuget package overrides](doc/features-nuget-package-overrides.md)
- [Prefetching](doc/features-prefetch.md)
- [PWA Support](doc/features-pwa.md)
- [4GB Support](doc/features-4gb.md)
- [HttpRequestMessage Extensions](doc/features-httprequestmessage-extensions.md)
Expand All @@ -45,3 +37,9 @@ This package is based on the excellent work from @praeclarum's [OOui Wasm MSBuil
- [Uno Version Checker](doc/features-version-checker.md)
- [Contributing](doc/contributing.md)
- [Release procedure](doc/release-procedure.md)

## Previous releases documentation

- [8.0.x](https://github.com/unoplatform/Uno.Wasm.Bootstrap/tree/release/stable/8.0/doc)
- [7.0.x](https://github.com/unoplatform/Uno.Wasm.Bootstrap/tree/release/stable/7.0/doc)
- [3.x](https://github.com/unoplatform/Uno.Wasm.Bootstrap/tree/release/stable/3.3/doc)
59 changes: 59 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
The Uno Platform uses third-party libraries and resources that may be
distributed under licenses different from the Uno Platform software.

In the event of accidental failure to list a required notice, please
bring it to our attention. Post an issue at :

https://github.com/unoplatform/uno/issues

The attached notices are provided for information only.

License notice for .NET Core
----------------------------

The MIT License (MIT)

Copyright (c) .NET Foundation and Contributors

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

License notice for ProtoBufJsonConverter
----------------------------

Copyright(c) 2023 Stef Heyenrath

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion build/ci/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@
"Multi-line code blocks"
],
"ignorePaths": [
"../doc/index.md"
"../doc/index.md",
]
}
34 changes: 32 additions & 2 deletions build/ci/dotnet-install.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
parameters:
DotNetVersion: '7.0.200'
DotNetVersion: '9.0.100-rc.1.24452.12'

steps:

- task: UseDotNet@2
displayName: 'Use .NET 6 SDK'
displayName: 'Use .NET SDK'
inputs:
version: ${{ parameters.DotNetVersion }}
includePreviewVersions: true

# Daily builds install
# - pwsh: |
# $DotNetRoot = "C:\hostedtoolcache\windows\dotnet"
# Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./build/installcli.ps1"
# & ./build/installcli.ps1 -c 9.0 -q daily -InstallDir $DotNetRoot

# condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))
# displayName: 'Setup .NET (Windows)'

# - pwsh: |
# wget https://dot.net/v1/dotnet-install.sh
# chmod +x dotnet-install.sh
# ./dotnet-install.sh -c 9.0 -q daily
# echo "[task.setvariable variable=PATH;]${env:PATH}:$env:HOME/.dotnet"
# echo "[task.setvariable variable=DOTNET_ROOT;]$env:HOME/.dotnet"

# echo "##vso[task.setvariable variable=PATH;]$env:HOME/.dotnet:${env:PATH}"
# echo "##vso[task.setvariable variable=DOTNET_ROOT;]$env:HOME/.dotnet"

# condition: and(succeeded(), ne( variables['Agent.OS'], 'Windows_NT' ))
# displayName: 'Setup .NET (Linux/macOS)'

- pwsh: |
cd src
dotnet --version
dotnet --list-sdks
dotnet workload install wasm-tools
displayName: Setup Workloads
50 changes: 23 additions & 27 deletions build/ci/stage-build-linux-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:

variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
WasmCachePath: $(Agent.TempDirectory)/emsdk-cache

steps:
- checkout: self
Expand All @@ -25,26 +26,19 @@ jobs:
- template: gitversion.yml
- template: dotnet-install.yml

- task: UseDotNet@2
displayName: 'Use .NET SDK'
inputs:
packageType: sdk
version: 8.0.100
includePreviewVersions: true

- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Bootstrap
dotnet msbuild /r /p:Configuration=Release /p:DISABLE_CLIHOST_NET6=true
dotnet msbuild /r /p:Configuration=Release
displayName: Build bootstrap
- bash: |
cd $(build.sourcesdirectory)/src
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true Uno.Wasm.Bootstrap-netcore-only.slnf /bl:$(build.artifactstagingdirectory)/SampleNet5.binlog
dotnet publish -c Release /m:1 Uno.Wasm.Bootstrap-netcore-only.slnf /bl:$(build.artifactstagingdirectory)/SampleNet5.binlog
displayName: Build NetCore-Wasm Sample
- task: CopyFiles@2
inputs:
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net6.0/publish
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net9.0/publish/wwwroot
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/Uno.Wasm.Sample.RayTracer
CleanTargetFolder: false
Expand All @@ -54,7 +48,7 @@ jobs:
## Raytracer validation
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net6.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/WasmAot.UITests" "http://localhost:8000/"
displayName: Raytracer UI Tests Net5
env:
Expand All @@ -63,43 +57,45 @@ jobs:
## Threads Interp validation
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true "/p:WasmShellWebAppBasePath=/"
dotnet clean -c Release
dotnet publish -c Release /m:1 "/p:WasmShellWebAppBasePath=/"
displayName: Build Threads test
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threads/bin/Release/net8.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threads/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threading.UITests" "http://localhost:8000/"
displayName: Threading UI Tests
condition: eq( variables['THREAD_TESTING'], 'true' )
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
### Threads AOT validation
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true "/p:WasmShellWebAppBasePath=/"
dotnet clean -c Release
dotnet publish -c Release /m:1 "/p:WasmShellWebAppBasePath=/"
displayName: Build Threads AOT test
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot/bin/Release/net6.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threads.Aot/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Threading.UITests" "http://localhost:8000/"
displayName: Threading AOT UI Tests
condition: eq( variables['THREAD_TESTING'], 'true' )
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
## SWA sub-path validation
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true "/p:WasmShellWebAppBasePath=/"
dotnet clean -c Release
dotnet publish -c Release /m:1 "/p:WasmShellWebAppBasePath=/"
displayName: Build RayTracer with sub-path
- task: CopyFiles@2
inputs:
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net6.0/publish
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net9.0/publish/wwwroot
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/subpath-override
CleanTargetFolder: false
Expand All @@ -108,7 +104,7 @@ jobs:

- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests-swa.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net6.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.Sample.RayTracer/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/WasmAot.UITests" "http://localhost:8000/test/inner"
displayName: Raytracer UI Tests Net5 (SWA)
env:
Expand All @@ -117,7 +113,7 @@ jobs:
## Static linking validation
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net6/bin/Release/net6.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net6/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.UITests" "http://localhost:8000/"
displayName: StaticLinking.Aot Tests net5
env:
Expand All @@ -126,7 +122,7 @@ jobs:
## Static linking validation (net7)
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.net7/bin/Release/net7.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.net7/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.UITests" "http://localhost:8000/"
displayName: StaticLinking.Aot Tests net7
env:
Expand All @@ -142,7 +138,7 @@ jobs:
## Static linking validation (net7)
- bash: |
$(build.sourcesdirectory)/build/scripts/run-tests-csp.sh \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.net7/bin/Release/net7.0/dist" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.net7/bin/Release/net9.0/publish/wwwroot" \
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.UITests" "http://localhost:8000/"
displayName: StaticLinking.Aot Tests net7 (CSP Enabled)
env:
Expand All @@ -160,7 +156,7 @@ jobs:
- task: CopyFiles@2
condition: always()
inputs:
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Server.net7/bin/Release/net7.0
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Server.net7/bin/Release/net9.0
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/Uno.Wasm.StaticLinking.Server.net7
CleanTargetFolder: false
Expand All @@ -170,8 +166,8 @@ jobs:
# Interpreter debug for symbols copy issue
- bash: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Interpreter
dotnet clean -c Debug /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Debug /m:1 /p:DISABLE_CLIHOST_NET6=true /p:WasmShellEmccLinkOptimization=false /bl:$(build.artifactstagingdirectory)/sample.debug-interpreter-linux-debug.binlog
dotnet clean -c Debug
dotnet publish -c Debug /m:1 /p:WasmShellEmccLinkOptimization=false /bl:$(build.artifactstagingdirectory)/sample.debug-interpreter-linux-debug.binlog
displayName: Build Debug Interpreter with linking Sample
- task: PublishBuildArtifacts@1
Expand Down
Loading

0 comments on commit 9cad02c

Please sign in to comment.