Skip to content

Commit

Permalink
Merge branch 'net9.0' into eilon/hwv-platform-cleanup-2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpeppers committed Sep 30, 2024
2 parents 6e4ab72 + 88b3562 commit 35cf769
Show file tree
Hide file tree
Showing 97 changed files with 1,353 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "10.0.0-prerelease.24467.4",
"version": "10.0.0-prerelease.24476.1",
"commands": [
"xharness"
]
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ body:
- 9.0.0-preview.3.10457
- 9.0.0-preview.2.10293
- 9.0.0-preview.1.9973
- 8.0.91 SR9.1
- 8.0.90 SR9
- 8.0.82 SR8.2
- 8.0.80 SR8
Expand Down Expand Up @@ -126,6 +127,7 @@ body:
- 8.0.80 SR8
- 8.0.82 SR8.2
- 8.0.90 SR9
- 8.0.91 SR9.1
- 9.0.0-preview.1.9973
- 9.0.0-preview.2.10293
- 9.0.0-preview.3.10457
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/similarIssues.yml

This file was deleted.

1 change: 1 addition & 0 deletions Microsoft.Maui-dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedSource", "SharedSource", "{4F2926C8-43AB-4328-A735-D9EAD699F81D}"
ProjectSection(SolutionItems) = preProject
src\BlazorWebView\src\SharedSource\AutoCloseOnReadCompleteStream.cs = src\BlazorWebView\src\SharedSource\AutoCloseOnReadCompleteStream.cs
src\BlazorWebView\src\SharedSource\HostAddressHelper.cs = src\BlazorWebView\src\SharedSource\HostAddressHelper.cs
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs = src\BlazorWebView\src\SharedSource\QueryStringHelper.cs
src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs = src\BlazorWebView\src\SharedSource\UrlLoadingEventArgs.cs
src\BlazorWebView\src\SharedSource\UrlLoadingStrategy.cs = src\BlazorWebView\src\SharedSource\UrlLoadingStrategy.cs
Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<add key="darc-pub-dotnet-emsdk-2674f58" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580/nuget/v3/index.json" />
<add key="darc-pub-dotnet-runtime-ed13b35" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-ed13b351/nuget/v3/index.json" />
<!-- Added manually for .NET 8 Android -->
<add key="darc-pub-dotnet-android-b0fd011" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-b0fd0113/nuget/v3/index.json" />
<add key="darc-pub-dotnet-android-45bb7f3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-45bb7f36/nuget/v3/index.json" />
<!-- Added manually for .NET 8 iOS -->
<add key="darc-pub-xamarin-xamarin-macios-bc01f5e" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-xamarin-xamarin-macios-bc01f5e0/nuget/v3/index.json" />
</packageSources>
Expand Down
10 changes: 10 additions & 0 deletions docs/design/FeatureSwitches.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The following switches are toggled for applications running on Mono for `TrimMod
| MauiQueryPropertyAttributeSupport | Microsoft.Maui.RuntimeFeature.IsQueryPropertyAttributeSupported | When disabled, the `[QueryProperty(...)]` attributes won't be used to set values to properties when navigating. |
| MauiImplicitCastOperatorsUsageViaReflectionSupport | Microsoft.Maui.RuntimeFeature.IsImplicitCastOperatorsUsageViaReflectionSupported | When disabled, MAUI won't look for implicit cast operators when converting values from one type to another. This feature is not trim-compatible. |
| _MauiBindingInterceptorsSupport | Microsoft.Maui.RuntimeFeature.AreBindingInterceptorsSupported | When disabled, MAUI won't intercept any calls to `SetBinding` methods and try to compile them. Enabled by default. |
| MauiEnableXamlCBindingWithSourceCompilation | Microsoft.Maui.RuntimeFeature.XamlCBindingWithSourceCompilationEnabled | When enabled, MAUI will compile all bindings, including those where the `Source` property is used. |

## MauiEnableIVisualAssemblyScanning

Expand Down Expand Up @@ -61,3 +62,12 @@ Compiled binding in XAML:
```xml
<Label Text="{Binding Customer.Name}" x:DataType="local:PageViewModel" />
```

## MauiEnableXamlCBindingWithSourceCompilation

XamlC skipped compilation of bindings with the `Source` property set to any value in previous releases. Some bindings might start producing build errors or start failing at runtime after this feature is enabled. After enabling this feature, make sure all bindings have the right `x:DataType` so they are compiled correctly. For bindings which should not be compiled, clear the data type like this:
```
{Binding MyProperty, Source={x:Reference MyTarget}, x:DataType={x:Null}}
```

This feature is disabled by default, unless `TrimMode=true` or `PublishAot=true`. For fully trimmed and NativeAOT apps, the feature is enabled.
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>6f23d04dc2b2039e9eaf97bee2ac02a77ce56b21</Sha>
</Dependency>
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="35.0.0-rc.2.87">
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="35.0.0-rc.2.134">
<Uri>https://github.com/dotnet/android</Uri>
<Sha>c77c22c9e281e518fddfbd2f3ec41939ba631778</Sha>
<Sha>b795a653460417af9da75f94e4a487a2665faa7f</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk.net9.0_17.5" Version="17.5.9334-net9-rc2">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
Expand Down Expand Up @@ -135,17 +135,17 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>46cfb747b4c22471242dee0d106f5c79cf9fd4c5</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="10.0.0-prerelease.24467.4">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="10.0.0-prerelease.24476.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>3cfb1a3d86da666fb80ba0adb970525e88339d57</Sha>
<Sha>7d5c32dbda0c6c8b9dc20cde4e1261b191896138</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="10.0.0-prerelease.24467.4">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="10.0.0-prerelease.24476.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>3cfb1a3d86da666fb80ba0adb970525e88339d57</Sha>
<Sha>7d5c32dbda0c6c8b9dc20cde4e1261b191896138</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="10.0.0-prerelease.24467.4">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="10.0.0-prerelease.24476.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>3cfb1a3d86da666fb80ba0adb970525e88339d57</Sha>
<Sha>7d5c32dbda0c6c8b9dc20cde4e1261b191896138</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
10 changes: 5 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Current previous .NET SDK major version's stable release of MAUI packages -->
<MicrosoftMauiPreviousDotNetReleasedVersion>8.0.70</MicrosoftMauiPreviousDotNetReleasedVersion>
<MicrosoftMauiPreviousDotNetReleasedVersion>8.0.82</MicrosoftMauiPreviousDotNetReleasedVersion>
<!-- dotnet/installer -->
<MicrosoftNETSdkPackageVersion>9.0.100-rc.2.24426.11</MicrosoftNETSdkPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftDotnetSdkInternalPackageVersion>
Expand All @@ -50,7 +50,7 @@
<MicrosoftExtensionsLoggingDebugVersion>9.0.0-rc.2.24463.7</MicrosoftExtensionsLoggingDebugVersion>
<MicrosoftExtensionsPrimitivesVersion>9.0.0-rc.2.24463.7</MicrosoftExtensionsPrimitivesVersion>
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>35.0.0-rc.2.87</MicrosoftAndroidSdkWindowsPackageVersion>
<MicrosoftAndroidSdkWindowsPackageVersion>35.0.0-rc.2.134</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftMacCatalystSdknet90_175PackageVersion>17.5.9334-net9-rc2</MicrosoftMacCatalystSdknet90_175PackageVersion>
<MicrosoftmacOSSdknet90_145PackageVersion>14.5.9334-net9-rc2</MicrosoftmacOSSdknet90_145PackageVersion>
Expand Down Expand Up @@ -124,9 +124,9 @@
<_HarfBuzzSharpVersion>7.3.0.2</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.7af1d0840a381c0ce7ef2877454a88dbb2949686.1086</_SkiaSharpNativeAssetsVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.114</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>10.0.0-prerelease.24467.4</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>10.0.0-prerelease.24467.4</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>10.0.0-prerelease.24467.4</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>10.0.0-prerelease.24476.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>10.0.0-prerelease.24476.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>10.0.0-prerelease.24476.1</MicrosoftDotNetXHarnessCLIVersion>
<TizenUIExtensionsVersion>0.9.2</TizenUIExtensionsVersion>
<SvgSkiaPackageVersion>1.0.0.16</SvgSkiaPackageVersion>
<FizzlerPackageVersion>1.3.0</FizzlerPackageVersion>
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/common/maui-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ jobs:
- template: provision.yml
parameters:
skipXcode: ${{ eq(RunPlatform.testName, 'RunOnAndroid') }}
skipAndroidImages: ${{ ne(RunPlatform.testName, 'RunOnAndroid') }}
checkoutDirectory: ${{ parameters.checkoutDirectory }}

- task: DownloadBuildArtifacts@0
Expand Down
27 changes: 14 additions & 13 deletions eng/pipelines/common/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,21 @@ steps:

# Setup JDK Paths (gradle needs it)
- bash: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)"
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_17_X64)"
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_17_X64)"
brew install --cask microsoft-openjdk@17
displayName: 'Setup JDK Paths'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
# Configure VS Mac for Xcode
# This seems to be needed or else it will pick other xcode for example on xharness
- bash: |
set -x
mkdir -p ~/Library/Preferences/Xamarin
rm -f ~/Library/Preferences/Xamarin/Settings.plist
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
cat ~/Library/Preferences/Xamarin/Settings.plist || true
displayName: 'Configure Visual Studio'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
# - bash: |
# set -x
# mkdir -p ~/Library/Preferences/Xamarin
# rm -f ~/Library/Preferences/Xamarin/Settings.plist
# /usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
# cat ~/Library/Preferences/Xamarin/Settings.plist || true
# displayName: 'Configure Visual Studio'
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))

# Prepare Windows
# Provision Additional Software
Expand All @@ -90,10 +91,10 @@ steps:
SKIP_ANDROID_API_IMAGES: 'true'

- pwsh: |
if ($env:JAVA_HOME_11_X64) {
$env:JAVA_HOME = $env:JAVA_HOME_11_X64
if ($env:JAVA_HOME_17_X64) {
$env:JAVA_HOME = $env:JAVA_HOME_17_X64
} else {
$path = (Get-ChildItem $env:ProgramFiles\Microsoft\jdk-11.*\bin\java.exe) | Select-Object -First 1
$path = (Get-ChildItem $env:ProgramFiles\Microsoft\jdk-17.*\bin\java.exe) | Select-Object -First 1
if ($path -and (Test-Path $path)) {
$env:JAVA_HOME = $path.Directory.Parent.FullName
}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variables:
- name: isTargetMainBranch
value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/main')]
- name: isLocPRBranch
value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'loc-hb')]
value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'lego')]
- name: isPullRequest
value: $[eq(variables['Build.Reason'], 'PullRequest')]
- name: isLocHandoffBranch
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ parameters:
name: $(androidTestsVmPool)
vmImage: $(androidTestsVmImage)
demands:
- macOS.Name -equals Ventura
- macOS.Name -equals Sonoma
- macOS.Architecture -equals x64

- name: iosPool
Expand Down
2 changes: 1 addition & 1 deletion eng/provisioning/provisioning.csx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if (IsMac)
{
ForceJavaCleanup();
MicrosoftOpenJdk ("11.0.13.8.1");
MicrosoftOpenJdk ("17.0.12");
//this is needed for tools on macos like for nuget pack additional target and for classic xamarin projects
Item("https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.206.macos10.xamarin.universal.pkg");

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "9.0.100-preview.7.24407.12"
"dotnet": "9.0.100-rc.1.24452.12"
},
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.44",
Expand Down
39 changes: 1 addition & 38 deletions src/BlazorWebView/src/Maui/BlazorWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
/// </summary>
public partial class BlazorWebView : View, IBlazorWebView
{
internal static string AppHostAddress { get; } = GetAppHostAddress();

private const string AppHostAddressAlways0000Switch = "BlazorWebView.AppHostAddressAlways0000";

private static bool IsAppHostAddressAlways0000Enabled =>
AppContext.TryGetSwitch(AppHostAddressAlways0000Switch, out var enabled) && enabled;

private static string GetAppHostAddress()
{
if (IsAppHostAddressAlways0000Enabled)
{
return "0.0.0.0";
}
else
{
#if IOS || MACCATALYST
// On iOS/MacCatalyst 18 and higher the 0.0.0.0 address does not work, so we use localhost instead.
// This preserves behavior on older versions of those systems, while defaulting to new behavior on
// the new system.

// Note that pre-release versions of iOS/MacCatalyst have the expected Major/Minor values,
// but the Build, MajorRevision, MinorRevision, and Revision values are all -1, so we need
// to pass in int.MinValue for those values.

if (System.OperatingSystem.IsIOSVersionAtLeast(major: 18, minor: int.MinValue, build: int.MinValue) ||
System.OperatingSystem.IsMacCatalystVersionAtLeast(major: 18, minor: int.MinValue, build: int.MinValue))
{
return "localhost";
}
else
{
return "0.0.0.0";
}
#else
return "0.0.0.0";
#endif
}
}
internal static string AppHostAddress { get; } = HostAddressHelper.GetAppHostAddress();

private readonly JSComponentConfigurationStore _jSComponents = new();

Expand Down
19 changes: 19 additions & 0 deletions src/BlazorWebView/src/SharedSource/HostAddressHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;

namespace Microsoft.AspNetCore.Components.WebView;

internal static class HostAddressHelper
{
private const string AppHostAddressAlways0000Switch = "BlazorWebView.AppHostAddressAlways0000";

private static bool IsAppHostAddressAlways0000Enabled =>
AppContext.TryGetSwitch(AppHostAddressAlways0000Switch, out var enabled) && enabled;

public static string GetAppHostAddress()
=> IsAppHostAddressAlways0000Enabled
? "0.0.0.0"
: "0.0.0.1";
}
4 changes: 2 additions & 2 deletions src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ internal class WebView2WebViewManager : WebViewManager
// Using an IP address means that WebView2 doesn't wait for any DNS resolution,
// making it substantially faster. Note that this isn't real HTTP traffic, since
// we intercept all the requests within this origin.
internal static readonly string AppHostAddress = "0.0.0.0";
internal static readonly string AppHostAddress = HostAddressHelper.GetAppHostAddress();

/// <summary>
/// Gets the application's base URI. Defaults to <c>https://0.0.0.0/</c>
/// Gets the application's base URI. Defaults to <c>https://0.0.0.1/</c>.
/// </summary>
protected static readonly string AppOrigin = $"https://{AppHostAddress}/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</PropertyGroup>
<PropertyGroup>
<XFDisableTargetsValidation>True</XFDisableTargetsValidation>
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>TRACE;DEBUG;PERF;APP</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<NoWarn>1701;1702;CS8305;8305;CA1416;0612;CS0672;CS0618</NoWarn>
<EnableDefaultPageItems>true</EnableDefaultPageItems>
<EnableDefaultXamlItems>false</EnableDefaultXamlItems>

<PublishReadyToRun>false</PublishReadyToRun>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsPackageType>MSIX</WindowsPackageType>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<_FastDeploymentDiagnosticLogging>True</_FastDeploymentDiagnosticLogging>
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/samples/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<UseMaui Condition=" '$(UseWorkload)' == 'true' ">true</UseMaui>
<DefaultXamlRuntime Condition=" '$(UseWorkload)' != 'true' ">Maui</DefaultXamlRuntime>
<WarningsNotAsErrors>$(WarningsNotAsErrors);XC0022;XC0023</WarningsNotAsErrors>
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
</PropertyGroup>
<Import Project="../../../Directory.Build.props" />
</Project>
</Project>
Loading

0 comments on commit 35cf769

Please sign in to comment.