Skip to content

Commit

Permalink
Merge pull request #1177 from unoplatform/dev/jela/net9
Browse files Browse the repository at this point in the history
chore: Update to net9
  • Loading branch information
jeromelaban authored Nov 8, 2024
2 parents f147f56 + d8c001f commit b753d73
Show file tree
Hide file tree
Showing 30 changed files with 608 additions and 287 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/azure-static-webapp.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: Uno.Gallery/bin/Release/net8.0-browserwasm/dist
DIST_PATH: Uno.Gallery/bin/Release/net9.0-browserwasm/publish/wwwroot

if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
Expand All @@ -26,6 +26,17 @@ jobs:
fetch-depth: 0 # Required for gitversion
submodules: true

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

- run: |
cd Uno.Gallery
dotnet workload install wasm-tools
name: Setup Workloads
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
Expand All @@ -38,19 +49,21 @@ jobs:
useConfigFile: true
configFilePath: build/gitversion.yml

- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '8.0.100'

- run: |
cd Uno.Gallery
dotnet build -c Release -p:TargetFrameworkOverride=net8.0-browserwasm "/p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }}"
dotnet publish -c Release -f net9.0-browserwasm "/p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }}" /bl:../binlogs/output.binlog
name: Build Gallery
- uses: actions/upload-artifact@v4
with:
name: wasm-site
path: ${{ env.DIST_PATH }}

- uses: actions/upload-artifact@v4
with:
name: logs
path: binlogs

- name: Publish to Azure Static WebApps
id: builddeploy_uno
continue-on-error: true
Expand All @@ -68,7 +81,7 @@ jobs:

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
PRI257: Ignore default language (en) not being one of the included resources (eg en-us, en-uk)
-->
<NoWarn>$(NoWarn);NU1507;NETSDK1201;PRI257</NoWarn>

<SkiaSharpVersion>2.88.9-preview.2.2</SkiaSharpVersion>
<UnoWasmBootstrapVersion>9.1.0-dev.41</UnoWasmBootstrapVersion>
</PropertyGroup>

</Project>
63 changes: 33 additions & 30 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
<Project ToolsVersion="15.0">
<!--
<!--
To update the version of Uno, you should instead update the Sdk version in the global.json file.
See https://aka.platform.uno/using-uno-sdk for more information.
-->
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageVersion Include="NunitXml.TestLogger" Version="3.1.15" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Uno.UITest.Helpers" Version="1.1.0-dev.70" />
<PackageVersion Include="Xamarin.UITest" Version="4.3.5" />
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageVersion Include="NunitXml.TestLogger" Version="3.1.15" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Uno.UITest.Helpers" Version="1.1.0-dev.70" />
<PackageVersion Include="Xamarin.UITest" Version="4.4.0" />

<PackageVersion Include="Uno.ShowMeTheXAML" Version="2.0.0-dev0015" />
<PackageVersion Include="Uno.ShowMeTheXAML.MSBuild" Version="2.0.0-dev0015" />
<PackageVersion Include="Uno.ShowMeTheXAML" Version="2.0.0-dev0015" />
<PackageVersion Include="Uno.ShowMeTheXAML.MSBuild" Version="2.0.0-dev0015" />

<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls" Version="7.1.200" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.200" />
<PackageVersion Include="Uno.Core.Extensions.Compatibility" Version="4.0.1" />
<PackageVersion Include="Uno.Core.Extensions.Disposables" Version="4.0.1" />
<PackageVersion Include="CommunityToolkit.WinUI.Lottie" Version="8.0.280225" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
<PackageVersion Include="VideoLAN.LibVLC.Windows" Version="3.0.18" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageVersion Include="Microsoft.TypeScript.Compiler" Version="3.1.5" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="4.6.4" />
<PackageVersion Include="nventive.Nimue.Application.Packaging" Version="0.1.0-alpha.58" />
<PackageVersion Include="Xamarin.TestCloud.Agent" Version="0.23.2" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls" Version="7.1.200" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.200" />
<PackageVersion Include="Uno.Core.Extensions.Compatibility" Version="4.0.1" />
<PackageVersion Include="Uno.Core.Extensions.Disposables" Version="4.0.1" />
<PackageVersion Include="CommunityToolkit.WinUI.Lottie" Version="8.0.280225" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
<PackageVersion Include="VideoLAN.LibVLC.Windows" Version="3.0.18" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.TypeScript.Compiler" Version="3.1.5" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="4.6.4" />
<PackageVersion Include="nventive.Nimue.Application.Packaging" Version="0.1.0-alpha.58" />
<PackageVersion Include="Xamarin.TestCloud.Agent" Version="0.23.2" />

</ItemGroup>
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="9.1.0-dev.41" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="9.1.0-dev.41" />

</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Uno.Gallery.UITests/Uno.Gallery.UITests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Uno.Gallery.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BADA71DC-7FFD-4EDC-9F28-FB74AEADC713}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.github\workflows\azure-static-webapp.yml = .github\workflows\azure-static-webapp.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
Expand Down
Binary file modified Uno.Gallery/Platforms/WebAssembly/aot-uitests.profile
Binary file not shown.
Binary file modified Uno.Gallery/Platforms/WebAssembly/aot.profile
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Uno.Gallery/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"Gallery (Desktop WSL2)": {
"commandName": "WSL2",
"commandLineArgs": "{ProjectDir}/bin/Debug/net8.0-desktop/Uno.Gallery.dll",
"commandLineArgs": "{ProjectDir}/bin/Debug/net9.0-desktop/Uno.Gallery.dll",
"distributionName": "",
"compatibleTargetFramework": "desktop"
}
Expand Down
96 changes: 78 additions & 18 deletions Uno.Gallery/Uno.Gallery.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<Project Sdk="Uno.Sdk">
<PropertyGroup>
<!-- Building with dotnet build -f net8.0-platform will still cause restore to happen for all TargetFrameworks -->
<!-- Building with dotnet build -f net9.0-platform will still cause restore to happen for all TargetFrameworks -->
<!-- which will force us to install all workloads even if not needed -->
<!-- To prevent that, we will pass TargetFrameworkOverride as a global property (i.e, dotnet build -p:TargetFrameworkOverride=net8.0-platform) -->
<!-- To prevent that, we will pass TargetFrameworkOverride as a global property (i.e, dotnet build -p:TargetFrameworkOverride=net9.0-platform) -->
<!-- That way, we set TargetFrameworks property to only the needed TargetFramework -->
<!-- NOTE: We cannot build with dotnet build -p:TargetFrameworks=net8.0-platform as that will flow to source generator project, which is incorrect -->
<!-- NOTE: We cannot build with dotnet build -p:TargetFrameworks=net9.0-platform as that will flow to source generator project, which is incorrect -->
<TargetFramework Condition="'$(TargetFrameworkOverride)'!=''">$(TargetFrameworkOverride)</TargetFramework>
<TargetFrameworks Condition="'$(TargetFrameworkOverride)'==''">
net8.0-android;
net8.0-ios;
net8.0-maccatalyst;
net8.0-windows10.0.19041;
net8.0-desktop;
net8.0-browserwasm;
net9.0-ios;
net9.0-maccatalyst;
net9.0-windows10.0.19041;
net9.0-desktop;
net9.0-browserwasm;
</TargetFrameworks>

<!-- android is disable on linux until ci is fixed -->
<TargetFrameworks Condition="'$(TargetFrameworkOverride)'=='' AND !$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net9.0-android;</TargetFrameworks>

<OutputType>Exe</OutputType>
<UnoSingleProject>true</UnoSingleProject>
<!-- Display name -->
Expand Down Expand Up @@ -68,25 +71,47 @@
<ProjectReference Include="..\Uno.Gallery.SourceGenerators\Uno.Gallery.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" SetPlatform="Platform=AnyCPU" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0-android' or '$(TargetFramework)'=='net8.0-ios' or '$(TargetFramework)'=='net8.0-maccatalyst'">
<ItemGroup Condition="
'$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'android'
or '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'ios'
or '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'maccatayst'">
<IncludeXamlNamespaces Include="mobile" Visible="False" />
<ExcludeXamlNamespaces Include="not_mobile" Visible="False" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0-desktop' OR '$(TargetFramework)'=='net8.0-browserwasm'">
<ItemGroup Condition="'$(TargetFramework)'=='net9.0-desktop' OR '$(TargetFramework)'=='net9.0-browserwasm'">
<IncludeXamlNamespaces Include="not_mobile" Visible="False" />
<ExcludeXamlNamespaces Include="mobile" Visible="False" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(System_PullRequest_IsFork)'!='True' and '$(TargetFramework)'=='net8.0-ios'">
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(System_PullRequest_IsFork)'!='True' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'ios' ">
<CodesignKey>iPhone Distribution</CodesignKey>
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup Condition="('$(Configuration)'=='Debug' or '$(IsUiAutomationMappingEnabled)'=='True') and '$(TargetFramework)'=='net8.0-ios'">
<ItemGroup Condition="('$(Configuration)'=='Debug' or '$(IsUiAutomationMappingEnabled)'=='True') and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'ios' ">
<PackageReference Include="Xamarin.TestCloud.Agent" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(System_PullRequest_IsFork)'!='True' and '$(TargetFramework)'=='net8.0-maccatalyst'">
<PropertyGroup Condition=" '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'browserwasm' ">
<WasmShellWebAppBasePath>/</WasmShellWebAppBasePath>
</PropertyGroup>

<PropertyGroup Condition=" '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'browserwasm' AND '$(Configuration)' == 'Release' ">
<WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>
<WasmShellEmccLinkOptimization>false</WasmShellEmccLinkOptimization>
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling>
<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>

<!--
Uncomment this block to generate a profile
<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>
<UnoXamlResourcesTrimming>false</UnoXamlResourcesTrimming>
<WasmShellEnableJiterpreter>false</WasmShellEnableJiterpreter>
-->
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(System_PullRequest_IsFork)'!='True' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'maccatalyst' ">
<MtouchUseLlvm>true</MtouchUseLlvm>
<CodeSigningKey>Apple Distribution: Uno Platform Inc. (PD74CHS9Z5)</CodeSigningKey>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
Expand All @@ -99,16 +124,16 @@
<CodesignProvision Condition="$(BUILD_SOURCEBRANCH.StartsWith('refs/heads/canaries'))">Uno Gallery Canary (Catalyst)</CodesignProvision>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(TargetFramework)'=='net8.0-android'">
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'android'">
<RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net8.0-windows10.0.19041'">
<ItemGroup Condition="'$(TargetFramework)'!='net9.0-windows10.0.19041'">
<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls" />
<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows10.0.19041'">
<ItemGroup Condition="'$(TargetFramework)'=='net9.0-windows10.0.19041'">
<PackageReference Include="CommunityToolkit.WinUI.Lottie" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" />
Expand All @@ -119,7 +144,9 @@
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0-browserwasm'">
<ItemGroup Condition=" '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'browserwasm' ">
<PackageReference Include="Uno.Wasm.Bootstrap" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" />
<PackageReference Include="Microsoft.TypeScript.Compiler">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand All @@ -128,7 +155,40 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<EmbeddedResource Include="Platforms\WebAssembly\WasmScripts\UnoGallery.js" />

<ConfigFiles Include="Platforms\WebAssembly\tsconfig.json" />

<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(WasmShellMonoRuntimeExecutionMode)'=='InterpreterAndAOT'">
<WasmAotFileName Condition="'$(IsUiAutomationMappingEnabled)'==''">aot.profile</WasmAotFileName>

<!--
Use smaller profile for UI tests to avoid the browser's memory
use to go higher than the Ci agent's availability
-->

<WasmAotFileName Condition="'$(IsUiAutomationMappingEnabled)'=='True'">aot-uitests.profile</WasmAotFileName>
</PropertyGroup>


<!-- https://github.com/dotnet/runtime/issues/109289 -->
<Target Name="Issue109289_Workaround" AfterTargets="_BrowserWasmWriteRspForLinking" Condition=" $(NETCoreSdkVersion.Contains('rc.2')) ">
<ItemGroup>
<_WasmLinkStepArgs Remove="@(_EmccLinkStepArgs)" />
<_EmccLinkStepArgs Remove="&quot;%(_WasmNativeFileForLinking.Identity)&quot;" />
<_WasmLinkDependencies Remove="@(_WasmNativeFileForLinking)" />

<_SkiaSharpToReorder Include="@(_WasmNativeFileForLinking)" Condition="$([System.String]::Copy('%(FullPath)').Contains('SkiaSharp'))" />
<_WasmNativeFileForLinking Remove="@(_SkiaSharpToReorder)" />
<_WasmNativeFileForLinking Include="@(_SkiaSharpToReorder)" />

<_EmccLinkStepArgs Include="&quot;%(_WasmNativeFileForLinking.Identity)&quot;" />
<_WasmLinkDependencies Include="@(_WasmNativeFileForLinking)" />
<_WasmLinkStepArgs Include="@(_EmccLinkStepArgs)" />
</ItemGroup>
</Target>
</Project>
Loading

0 comments on commit b753d73

Please sign in to comment.